@@ -87,10 +87,16 @@ export const MobileNavigation: React.FC<MobileNavigationProps> = ({ isOpen, onCl
8787 . filter ( ( s ) => ! s . hide )
8888 . map ( ( menu ) => (
8989 < MenuItem isMainPath = { isMainPath } key = { menu . id } >
90- < MenuLink isMainPath = { isMainPath } to = { menu . route_code } onClick = { handleClose } >
91- { menu . name }
92- </ MenuLink >
93- { ! R . isEmpty ( menu . children ) && (
90+ { ! R . isEmpty ( menu . children ) && Object . values ( menu . children ) . some ( ( child ) => ! child . hide ) ? (
91+ < MenuButton isMainPath = { isMainPath } onClick = { ( ) => navigateToDepth2 ( menu ) } >
92+ { menu . name }
93+ </ MenuButton >
94+ ) : (
95+ < MenuLink isMainPath = { isMainPath } to = { menu . route_code } onClick = { handleClose } >
96+ { menu . name }
97+ </ MenuLink >
98+ ) }
99+ { ! R . isEmpty ( menu . children ) && Object . values ( menu . children ) . some ( ( child ) => ! child . hide ) && (
94100 < MenuArrowButton isMainPath = { isMainPath } onClick = { ( ) => navigateToDepth2 ( menu ) } >
95101 < ArrowForward fontSize = "small" />
96102 </ MenuArrowButton >
@@ -123,7 +129,7 @@ export const MobileNavigation: React.FC<MobileNavigationProps> = ({ isOpen, onCl
123129 < Link to = { `${ navState . depth1 ! . route_code } /${ menu . route_code } ` } onClick = { handleClose } style = { { textDecoration : "none" } } >
124130 < MenuChip isMainPath = { isMainPath } label = { menu . name } clickable />
125131 </ Link >
126- { ! R . isEmpty ( menu . children ) && (
132+ { ! R . isEmpty ( menu . children ) && Object . values ( menu . children ) . some ( ( child ) => ! child . hide ) && (
127133 < MenuArrowButton isMainPath = { isMainPath } onClick = { ( ) => navigateToDepth3 ( menu ) } >
128134 < ArrowForward fontSize = "small" />
129135 </ MenuArrowButton >
@@ -250,6 +256,17 @@ const MenuLink = styled(Link)<{ isMainPath?: boolean }>(({ theme, isMainPath = t
250256 fontWeight : 600 ,
251257} ) ) ;
252258
259+ const MenuButton = styled ( Button ) < { isMainPath ?: boolean } > ( ( { theme, isMainPath = true } ) => ( {
260+ color : isMainPath ? theme . palette . mobileNavigation . main . text : theme . palette . mobileNavigation . sub . text ,
261+ textTransform : "none" ,
262+ fontSize : "20px" ,
263+ fontWeight : 600 ,
264+ padding : 0 ,
265+ minWidth : "auto" ,
266+ minHeight : "auto" ,
267+ justifyContent : "flex-start" ,
268+ } ) ) ;
269+
253270const MenuArrowButton = styled ( IconButton ) < { isMainPath ?: boolean } > ( ( { theme, isMainPath = true } ) => ( {
254271 color : isMainPath ? theme . palette . mobileNavigation . main . text : theme . palette . mobileNavigation . sub . text ,
255272 padding : 8 ,
0 commit comments