mirror of
https://github.com/wavetermdev/docusaurus-og.git
synced 2026-08-05 13:46:35 -07:00
fix: hide ‘Back to main menu’ button when the main menu is empty
This commit is contained in:
+4
-1
@@ -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 (
|
||||
<>
|
||||
<SecondaryMenuBackButton onClick={() => secondaryMenu.hide()} />
|
||||
{!isPrimaryMenuEmpty && (
|
||||
<SecondaryMenuBackButton onClick={() => secondaryMenu.hide()} />
|
||||
)}
|
||||
{secondaryMenu.content}
|
||||
</>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user