24 | )
25 | }
26 |
--------------------------------------------------------------------------------
/docs/src/theme/Navbar/MobileSidebar/PrimaryMenu/index.tsx:
--------------------------------------------------------------------------------
1 | import React, { type ReactNode } from 'react'
2 | import { useThemeConfig } from '@docusaurus/theme-common'
3 | import { useNavbarMobileSidebar } from '@docusaurus/theme-common/internal'
4 | import NavbarItem, { type Props as NavbarItemConfig } from '@theme/NavbarItem'
5 |
6 | function useNavbarItems() {
7 | // TODO temporary casting until ThemeConfig type is improved
8 | return useThemeConfig().navbar.items as NavbarItemConfig[]
9 | }
10 |
11 | // The primary menu displays the navbar items
12 | export default function NavbarMobilePrimaryMenu(): ReactNode {
13 | const mobileSidebar = useNavbarMobileSidebar()
14 |
15 | // TODO how can the order be defined for mobile?
16 | // Should we allow providing a different list of items?
17 | const items = useNavbarItems()
18 |
19 | return (
20 |