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:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user