@@ -22,20 +22,15 @@ import {
2222 useState ,
2323} from "react"
2424import scrollIntoView from "scroll-into-view-if-needed"
25- import {
26- useActiveAnchor ,
27- useMenu ,
28- useThemeConfig ,
29- Collapse ,
30- LocaleSwitch ,
31- } from "nextra-theme-docs"
25+ import { useActiveAnchor , useThemeConfig , Collapse } from "nextra-theme-docs"
3226
3327import ArrowBarLeft from "@/app/conf/_design-system/pixelarticons/arrow-bar-left.svg?svgr"
3428import { Anchor } from "@/app/conf/_design-system/anchor"
3529
36- import { renderComponent } from "./utils/render-component"
37- import { ThemeSwitch } from "./theme-switch"
38- import { Flexsearch } from "./flexsearch"
30+ import { renderComponent } from "../utils/render-component"
31+ import { ThemeSwitch } from "../theme-switch"
32+ import { Flexsearch } from "../flexsearch"
33+ import { useMenu } from "../use-menu"
3934
4035const TreeState : Record < string , boolean > = Object . create ( null )
4136
@@ -229,7 +224,7 @@ function Separator({ title }: { title: string }): ReactElement {
229224 className = { cn (
230225 "[word-break:break-word]" ,
231226 title
232- ? "typography-body-sm mb-2 px-2 py-1.5 font-semibold text-neu-800 [&:not(:first-child)]:mt-5"
227+ ? "typography-body-sm mb-2 px-2 py-1.5 font-semibold text-neu-800 max-md:first:hidden [&:not(:first-child)]:mt-5"
233228 : "my-4" ,
234229 ) }
235230 >
@@ -370,7 +365,6 @@ export function Sidebar({
370365 const { menu, setMenu } = useMenu ( )
371366 const [ focused , setFocused ] = useState ( "" )
372367 const [ showSidebar , setSidebar ] = useState ( true )
373- const [ showToggleAnimation , setToggleAnimation ] = useState ( false )
374368
375369 const anchors = useMemo ( ( ) => toc . filter ( v => v . depth === 2 ) , [ toc ] )
376370 const sidebarRef = useRef < HTMLDivElement > ( null ! )
@@ -480,7 +474,6 @@ export function Sidebar({
480474 < SidebarFooter
481475 showSidebar = { showSidebar }
482476 setSidebar = { setSidebar }
483- showToggleAnimation = { showToggleAnimation }
484477 hasI18n = { hasI18n }
485478 />
486479 ) }
@@ -492,17 +485,13 @@ export function Sidebar({
492485export function SidebarFooter ( {
493486 showSidebar,
494487 setSidebar,
495- showToggleAnimation = false ,
496488 hasI18n = false ,
497- setToggleAnimation,
498489 className,
499490 hiddenOnMobile = true ,
500491} : {
501492 showSidebar : boolean
502493 setSidebar : ( show : boolean ) => void
503- showToggleAnimation ?: boolean
504494 hasI18n ?: boolean
505- setToggleAnimation ?: ( show : boolean ) => void
506495 className ?: string
507496 hiddenOnMobile ?: boolean
508497} ) {
@@ -519,14 +508,7 @@ export function SidebarFooter({
519508 : "flex-col flex-wrap justify-center py-4" ,
520509 className ,
521510 ) }
522- data-toggle-animation = {
523- showToggleAnimation ? ( showSidebar ? "show" : "hide" ) : "off"
524- }
525511 >
526- < LocaleSwitch
527- lite = { ! showSidebar }
528- className = { showSidebar ? "_grow" : "max-md:_grow" }
529- />
530512 < div className = { showSidebar && ! hasI18n ? "_grow _flex _flex-col" : "" } >
531513 < ThemeSwitch lite = { ! showSidebar } />
532514 </ div >
@@ -539,7 +521,6 @@ export function SidebarFooter({
539521 ) }
540522 onClick = { ( ) => {
541523 setSidebar ( ! showSidebar )
542- setToggleAnimation ?.( true )
543524 } }
544525 >
545526 < ArrowBarLeft
0 commit comments