File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -442,8 +442,10 @@ html[data-theme="dark"] .theme-toggle .icon-moon {
442442 margin-right : auto;
443443 }
444444
445- . navbar-sidebar__brand . theme-toggle {
446- margin : 0 ;
445+ /* The theme switch lives in the page navbar; the sidebar is docs navigation only */
446+ . navbar-sidebar__brand . theme-toggle ,
447+ . navbar-sidebar__back {
448+ display : none;
447449 }
448450}
449451
Original file line number Diff line number Diff line change 1+ import React from "react" ;
2+ import clsx from "clsx" ;
3+ import { useNavbarSecondaryMenu } from "@docusaurus/theme-common/internal" ;
4+ import { ThemeClassNames } from "@docusaurus/theme-common" ;
5+
6+ // Single-panel mobile menu: the version selector (the only main-menu item shown on
7+ // mobile) above the docs sidebar, instead of the default two sliding panels.
8+ export default function NavbarMobileSidebarLayout ( { header, primaryMenu, secondaryMenu } ) {
9+ const { content } = useNavbarSecondaryMenu ( ) ;
10+ const hasSidebar = Boolean ( content ) ;
11+
12+ return (
13+ < div className = { clsx ( ThemeClassNames . layout . navbar . mobileSidebar . container , "navbar-sidebar" ) } >
14+ { header }
15+ < div className = "navbar-sidebar__items" >
16+ < div
17+ className = { clsx ( ThemeClassNames . layout . navbar . mobileSidebar . panel , "navbar-sidebar__item menu" ) }
18+ >
19+ { primaryMenu }
20+ { hasSidebar && secondaryMenu }
21+ </ div >
22+ </ div >
23+ </ div >
24+ ) ;
25+ }
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ export default function GitHubNavbarItem({ mobile = false }) {
44 const [ stars , setStars ] = useState ( null ) ;
55
66 useEffect ( ( ) => {
7+ if ( mobile ) return undefined ;
8+
79 const controller = new AbortController ( ) ;
810
911 async function loadStars ( ) {
@@ -28,10 +30,12 @@ export default function GitHubNavbarItem({ mobile = false }) {
2830
2931 loadStars ( ) ;
3032 return ( ) => controller . abort ( ) ;
31- } , [ ] ) ;
33+ } , [ mobile ] ) ;
34+
35+ if ( mobile ) return null ;
3236
3337 return (
34- < div className = { mobile ? "menu__list-item" : " navbar__item"} >
38+ < div className = " navbar__item">
3539 < a
3640 className = "nav-icon nav-github"
3741 href = "https://github.com/FEAScript/FEAScript-core"
You can’t perform that action at this time.
0 commit comments