@@ -87,10 +87,16 @@ export const MobileNavigation: React.FC<MobileNavigationProps> = ({ isOpen, onCl
87
87
. filter ( ( s ) => ! s . hide )
88
88
. map ( ( menu ) => (
89
89
< 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 ) && (
94
100
< MenuArrowButton isMainPath = { isMainPath } onClick = { ( ) => navigateToDepth2 ( menu ) } >
95
101
< ArrowForward fontSize = "small" />
96
102
</ MenuArrowButton >
@@ -123,7 +129,7 @@ export const MobileNavigation: React.FC<MobileNavigationProps> = ({ isOpen, onCl
123
129
< Link to = { `${ navState . depth1 ! . route_code } /${ menu . route_code } ` } onClick = { handleClose } style = { { textDecoration : "none" } } >
124
130
< MenuChip isMainPath = { isMainPath } label = { menu . name } clickable />
125
131
</ Link >
126
- { ! R . isEmpty ( menu . children ) && (
132
+ { ! R . isEmpty ( menu . children ) && Object . values ( menu . children ) . some ( ( child ) => ! child . hide ) && (
127
133
< MenuArrowButton isMainPath = { isMainPath } onClick = { ( ) => navigateToDepth3 ( menu ) } >
128
134
< ArrowForward fontSize = "small" />
129
135
</ MenuArrowButton >
@@ -250,6 +256,17 @@ const MenuLink = styled(Link)<{ isMainPath?: boolean }>(({ theme, isMainPath = t
250
256
fontWeight : 600 ,
251
257
} ) ) ;
252
258
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
+
253
270
const MenuArrowButton = styled ( IconButton ) < { isMainPath ?: boolean } > ( ( { theme, isMainPath = true } ) => ( {
254
271
color : isMainPath ? theme . palette . mobileNavigation . main . text : theme . palette . mobileNavigation . sub . text ,
255
272
padding : 8 ,
0 commit comments