From d6d0826299100f9f1deeaf2c499ed16346784979 Mon Sep 17 00:00:00 2001 From: Vega Date: Wed, 19 Feb 2025 10:32:24 -0800 Subject: [PATCH 1/2] fix visibilty of secondary navbar --- src/components/SelectComponent/SelectComponent.js | 4 ++++ src/theme/Navbar/index.tsx | 11 ++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/components/SelectComponent/SelectComponent.js b/src/components/SelectComponent/SelectComponent.js index fa6c29ae91..aeff3bb34f 100644 --- a/src/components/SelectComponent/SelectComponent.js +++ b/src/components/SelectComponent/SelectComponent.js @@ -11,6 +11,8 @@ export default function SelectComponent() { const currentPath = normalizePath(location.pathname); const aiUnlimitedUrl = useBaseUrl('/ai-unlimited/install-ai-unlimited'); const fabricUrl = useBaseUrl('/ai-unlimited/fabric/get-started'); + const pathsNoAlert = normalizePath(`/quickstarts/`); + const shouldDisplayAlert = !currentPath.includes(pathsNoAlert); useEffect(() => { if (currentPath === aiUnlimitedUrl) { @@ -29,6 +31,8 @@ export default function SelectComponent() { } }; + if (!shouldDisplayAlert) return null; + return ( {() => { diff --git a/src/theme/Navbar/index.tsx b/src/theme/Navbar/index.tsx index 32a8435faa..38172a34ef 100644 --- a/src/theme/Navbar/index.tsx +++ b/src/theme/Navbar/index.tsx @@ -72,16 +72,17 @@ export default function Navbar() { type: 'button', }, ]; - + + const navbarContent = useNavbarSecondaryMenu().content as JSX.Element; const secondaryMenuDetails = { - menuElement: ( + menuElement: navbarContent ? ( <>
- +
- {useNavbarSecondaryMenu().content} + {navbarContent} - ), + ) : null, title: translate({ message: 'sidenav.title', description: 'sidenav.title_description', From 89a38e22712f5daa7310005c0e981aeb0b1e8eed Mon Sep 17 00:00:00 2001 From: Vega Date: Wed, 19 Feb 2025 18:04:22 -0800 Subject: [PATCH 2/2] fix-build --- src/theme/Navbar/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/theme/Navbar/index.tsx b/src/theme/Navbar/index.tsx index 38172a34ef..e8d9346a8d 100644 --- a/src/theme/Navbar/index.tsx +++ b/src/theme/Navbar/index.tsx @@ -82,7 +82,7 @@ export default function Navbar() { {navbarContent} - ) : null, + ) : <>, title: translate({ message: 'sidenav.title', description: 'sidenav.title_description',