diff --git a/public/apps/account/account-app.tsx b/public/apps/account/account-app.tsx index 879eb5a9..0f973a1b 100644 --- a/public/apps/account/account-app.tsx +++ b/public/apps/account/account-app.tsx @@ -107,9 +107,10 @@ export async function setupTopNavButton(coreStart: CoreStart, config: ClientConf setShouldShowTenantPopup(shouldShowTenantPopup); - coreStart.chrome.navControls.registerRight({ - // Pin to rightmost, since newsfeed plugin is using 1000, here needs a number > 1000 - order: 2000, + const isPlacedInLeftNav = coreStart.uiSettings.get('home:useNewHomePage'); + + coreStart.chrome.navControls[isPlacedInLeftNav ? 'registerLeftBottom' : 'registerRight']({ + order: isPlacedInLeftNav ? 10000 : 2000, mount: (element: HTMLElement) => { ReactDOM.render( { try { setIsMultiTenancyEnabled( - (await getDashboardsInfo(props.coreStart.http)).multitenancy_enabled + Boolean((await getDashboardsInfo(props.coreStart.http)).multitenancy_enabled) ); } catch (e) { // TODO: switch to better error display. @@ -167,12 +168,31 @@ export function AccountNavButton(props: { /> ); - return ( - + + const isPlacedInLeftNav = props.coreStart.uiSettings.get('home:useNewHomePage'); + + // ToDo: Add aria-label and tooltip when isPlacedInLeftNav is true + const innerElement = isPlacedInLeftNav ? ( + + + + ) : ( + + ); + + const popover = ( + <> } + anchorPosition={isPlacedInLeftNav ? 'rightDown' : undefined} + button={innerElement} isOpen={isPopoverOpen} closePopover={() => { setPopoverOpen(false); @@ -185,6 +205,14 @@ export function AccountNavButton(props: { {contextMenuPanel} {modal} + + ); + + return isPlacedInLeftNav ? ( + popover + ) : ( + + {popover} ); }