mirror of
https://github.com/wavetermdev/docusaurus-og.git
synced 2026-08-05 13:46:35 -07:00
fix: display back to main navbar menu on mobile even if the navbar is empty
This commit is contained in:
@@ -35,5 +35,6 @@
|
||||
"devDependencies": {
|
||||
"@types/fs-extra": "^9.0.13",
|
||||
"@types/lodash": "^4.14.186"
|
||||
}
|
||||
},
|
||||
"gitHead": "d2ee08c6c0678f78ad70f5d04183f7f781d11563"
|
||||
}
|
||||
|
||||
@@ -30,5 +30,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/lodash": "^4.14.186"
|
||||
}
|
||||
},
|
||||
"gitHead": "d2ee08c6c0678f78ad70f5d04183f7f781d11563"
|
||||
}
|
||||
|
||||
@@ -68,5 +68,6 @@
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.14"
|
||||
}
|
||||
},
|
||||
"gitHead": "d2ee08c6c0678f78ad70f5d04183f7f781d11563"
|
||||
}
|
||||
|
||||
+3
-7
@@ -1,9 +1,9 @@
|
||||
import React from 'react'
|
||||
import { Typography } from '@acid-info/lsd-react'
|
||||
import { useThemeConfig } from '@docusaurus/theme-common'
|
||||
import { useNavbarSecondaryMenu } from '@docusaurus/theme-common/internal'
|
||||
import Translate from '@docusaurus/Translate'
|
||||
import { Typography } from '@acid-info/lsd-react'
|
||||
import { IconArrowLeft } from '@logos-theme/components/Icon'
|
||||
import React from 'react'
|
||||
|
||||
function SecondaryMenuBackButton(props) {
|
||||
return (
|
||||
@@ -24,14 +24,10 @@ 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 (
|
||||
<>
|
||||
{/* edge-case: prevent returning to the primaryMenu when it's empty */}
|
||||
{!isPrimaryMenuEmpty && (
|
||||
<SecondaryMenuBackButton onClick={() => secondaryMenu.hide()} />
|
||||
)}
|
||||
<SecondaryMenuBackButton onClick={() => secondaryMenu.hide()} />
|
||||
{secondaryMenu.content}
|
||||
</>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user