From f950f2508a9fd4a5be0ca47dcdbd5d0c53142a4b Mon Sep 17 00:00:00 2001 From: Hossein Mehrabi Date: Wed, 19 Jul 2023 10:50:45 +0330 Subject: [PATCH] =?UTF-8?q?fix:=20hide=20=E2=80=98Back=20to=20main=20menu?= =?UTF-8?q?=E2=80=99=20button=20when=20the=20main=20menu=20is=20empty?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../theme/Navbar/MobileSidebar/SecondaryMenu/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/logos-docusaurus-theme/src/client/theme/Navbar/MobileSidebar/SecondaryMenu/index.tsx b/packages/logos-docusaurus-theme/src/client/theme/Navbar/MobileSidebar/SecondaryMenu/index.tsx index 64e1b7c..39735cb 100644 --- a/packages/logos-docusaurus-theme/src/client/theme/Navbar/MobileSidebar/SecondaryMenu/index.tsx +++ b/packages/logos-docusaurus-theme/src/client/theme/Navbar/MobileSidebar/SecondaryMenu/index.tsx @@ -24,10 +24,13 @@ function SecondaryMenuBackButton(props) { // The secondary menu slides from the right and shows contextual information // such as the docs sidebar export default function NavbarMobileSidebarSecondaryMenu() { + const isPrimaryMenuEmpty = useThemeConfig().navbar.items.length === 0 const secondaryMenu = useNavbarSecondaryMenu() return ( <> - secondaryMenu.hide()} /> + {!isPrimaryMenuEmpty && ( + secondaryMenu.hide()} /> + )} {secondaryMenu.content} )