11import ExpandLessIcon from '@mui/icons-material/ExpandLess' ;
22import ExpandMoreIcon from '@mui/icons-material/ExpandMore' ;
3- import { ListItemTextProps , MenuListProps } from '@mui/material' ;
3+ import { ListItemTextProps , MenuListProps , useMediaQuery , useTheme } from '@mui/material' ;
44import React , { MouseEvent , useState } from 'react' ;
55import { Collapse , Divider , ListItemText , MenuItem } from '../../base' ;
66import { IconWrapper , MenuItemList , MenuItemSubList , MenuListStyle , SubIconWrapper } from './style' ;
@@ -13,6 +13,7 @@ type NavigationItem = {
1313 onClick : ( ) => void ;
1414 subItems ?: NavigationItem [ ] ;
1515 addDivider ?: boolean ;
16+ showOnWeb ?: boolean ;
1617} ;
1718
1819interface NavigationNavbarProps {
@@ -26,6 +27,8 @@ const NavigationNavbar: React.FC<NavigationNavbarProps> = ({
2627 MenuListProps = { } ,
2728 ListItemTextProps = { }
2829} ) => {
30+ const theme = useTheme ( ) ;
31+ const isDesktop = useMediaQuery ( theme . breakpoints . up ( 'sm' ) ) ;
2932 const [ openSectionId , setOpenSectionId ] = useState < string | null > ( null ) ;
3033 const toggleSectionOpen = ( sectionId : string , event : MouseEvent < SVGSVGElement > ) => {
3134 event . stopPropagation ( ) ;
@@ -41,6 +44,12 @@ const NavigationNavbar: React.FC<NavigationNavbarProps> = ({
4144 const permission = item . permission ?? true ;
4245 const addDivider = item . addDivider ?? false ;
4346
47+ const showOnWeb = item . showOnWeb ?? true ;
48+
49+ if ( ! showOnWeb && isDesktop ) {
50+ return null ;
51+ }
52+
4453 return (
4554 < React . Fragment key = { item . id } >
4655 < MenuItem disabled = { ! permission } onClick = { item . onClick } >
0 commit comments