feat(plugin): expose OrgSwitcher slot in extraRender

Add a single host-side mount point in extraRender.tsx:

    const OrgSwitcher = pluginManager?.components?.OrgSwitcher;
    ...
    {OrgSwitcher && <OrgSwitcher />}

A registered plugin can supply an Org switcher via
components.OrgSwitcher. When no plugin provides it, the host
renders nothing here, so the build is visually unchanged.
This commit is contained in:
gitlawr
2026-05-07 18:16:42 +08:00
committed by jialin
parent 65ad57fc4c
commit b6bbe880a0
2 changed files with 21 additions and 1 deletions
+5
View File
@@ -120,6 +120,10 @@ export const ExtraContent = (props: { isDarkTheme?: boolean }) => {
const { initialState } = initialInfo;
const GlobalSettings = pluginManager?.components?.GlobalSettings;
// Plugin slot. A registered plugin can supply an Org switcher via
// components.OrgSwitcher; the host renders nothing when no plugin
// provides it.
const OrgSwitcher = pluginManager?.components?.OrgSwitcher;
console.log('plugin+++++++++', pluginManager);
const navigate = useNavigate();
@@ -271,6 +275,7 @@ export const ExtraContent = (props: { isDarkTheme?: boolean }) => {
return (
<Wrapper>
{contextHolder}
{OrgSwitcher && <OrgSwitcher isDarkTheme={isDarkTheme} />}
<div
style={{
display: 'flex',