diff --git a/frontend/src/components/App/Layout.tsx b/frontend/src/components/App/Layout.tsx index 5be1c59afa..6d6d77502a 100644 --- a/frontend/src/components/App/Layout.tsx +++ b/frontend/src/components/App/Layout.tsx @@ -202,12 +202,27 @@ export default function Layout({}: LayoutProps) { > {t('Skip to main content')} - + -
+
{allClusters && !!clusterInURL && !Object.keys(allClusters).includes(getCluster() || '') ? ( @@ -217,7 +232,7 @@ export default function Layout({}: LayoutProps) { )} -
+
{arePluginsLoaded && ( diff --git a/frontend/src/components/App/__snapshots__/TopBar.NoToken.stories.storyshot b/frontend/src/components/App/__snapshots__/TopBar.NoToken.stories.storyshot index ddc6df30a2..a0ad4c190b 100644 --- a/frontend/src/components/App/__snapshots__/TopBar.NoToken.stories.storyshot +++ b/frontend/src/components/App/__snapshots__/TopBar.NoToken.stories.storyshot @@ -5,7 +5,7 @@ class="MuiPaper-root MuiPaper-elevation MuiPaper-elevation1 MuiAppBar-root MuiAppBar-colorPrimary MuiAppBar-positionFixed mui-fixed css-1nczbvg-MuiPaper-root-MuiAppBar-root" >
{ const { t } = useTranslation(); + const listContainerRef = React.useRef(null); + const [isOverflowing, setIsOverflowing] = React.useState(false); + const adjustedDrawerWidthClosed = isOverflowing ? 84 : 72; const temporarySideBarOpen = open === true && isTemporaryDrawer && openUserSelected === true; // The large sidebar does not open in medium view (600-960px). @@ -276,8 +279,10 @@ export const PureSidebar = memo( })} /> { + const el = listContainerRef.current; + if (!el) { + return; + } + + const observer = new ResizeObserver(() => { + setIsOverflowing(el.scrollHeight > el.clientHeight); + }); + + observer.observe(el); + + setIsOverflowing(el.scrollHeight > el.clientHeight); + + return () => observer.disconnect(); + }, [items]); + return (