File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ export type SidebarMenuItem = {
1414 href ?: string ;
1515 position : number ;
1616 description ?: string ;
17+ hidden ?: boolean ,
1718} ;
1819
1920type SidebatMenuItemProps = {
@@ -38,7 +39,7 @@ export function SidebarMenuItem({ level = 1, item }: SidebatMenuItemProps) {
3839 const [ open , setOpen ] = useState < boolean > ( checkOpen ( pathname , item ) ) ;
3940 const theme = useTheme ( ) ;
4041 const sx = {
41- display : "block" ,
42+ display : item . hidden ? "none" : "block" ,
4243 overflow : "hidden" ,
4344 textOverflow : "ellipsis" ,
4445 whiteSpace : "nowrap" ,
@@ -63,7 +64,9 @@ export function SidebarMenuItem({ level = 1, item }: SidebatMenuItemProps) {
6364 } , [ pathname , item ] ) ;
6465
6566 return (
66- < Box className = "item" >
67+ < Box className = "item" sx = { {
68+ display : item . hidden ? 'none' : 'block'
69+ } } >
6770 < Box >
6871 { item . href && _ . isEmpty ( item . children ) ? (
6972 < Tooltip title = { item . description } placement = "right" arrow >
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ export const getMarkDownSideBar = async (
5252 label : metadata . title || metadata . sidebar_label ,
5353 href : urlPath . replace ( / ^ \/ ( e n | z h ) / , "/docs" ) ,
5454 description : metadata . description ,
55+ hidden : Boolean ( metadata . hidden ) ,
5556 } ) ;
5657 resolve ( item ) ;
5758 } )
You can’t perform that action at this time.
0 commit comments