File tree Expand file tree Collapse file tree 1 file changed +19
-5
lines changed
Expand file tree Collapse file tree 1 file changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,20 @@ const drawerWidth = 240;
2121export default function SideMenu ( ) {
2222
2323 const context = useContext ( PageContext ) ;
24+
25+ const menuItems = [ {
26+ text : "Home" ,
27+ href : context . sandboxId ? `/sandbox/${ context . sandboxId } ` : "/" ,
28+ icon : < HomeIcon /> ,
29+ displayText : "Home" ,
30+ } ,
31+ {
32+ text : "Dashboard" ,
33+ href : context . sandboxId ? `/sandbox/dashboard/${ context . sandboxId } ` : "/dashboard" ,
34+ icon : < CheckIcon /> ,
35+ displayText : "Validation" ,
36+ } , ] ;
37+
2438 return (
2539 < Drawer
2640 variant = "permanent"
@@ -34,13 +48,13 @@ export default function SideMenu() {
3448 < Toolbar />
3549 < Box sx = { { overflow : 'auto' , paddingTop :'5vh' } } >
3650 < List >
37- { [ 'Home' , 'Dashboard' ] . map ( ( text , index ) => (
38- < ListItem key = { text } disablePadding style = { { 'borderLeft' : context . pageTitle === text . toLowerCase ( ) ? 'thick solid #1976d2' : 'none' } } >
39- < ListItemButton href = { text === "Home" ? context . sandboxId ? `/sandbox/ ${ context . sandboxId } ` : "/" : context . sandboxId ? `/sandbox/dashboard/ ${ context . sandboxId } ` : "/dashboard" } >
51+ { menuItems . map ( ( item , index ) => (
52+ < ListItem key = { item . text } disablePadding style = { { 'borderLeft' : context . pageTitle === item . text . toLowerCase ( ) ? 'thick solid #1976d2' : 'none' } } >
53+ < ListItemButton href = { item . href } >
4054 < ListItemIcon >
41- { text === "Home" ? < HomeIcon /> : < CheckIcon /> }
55+ { item . icon }
4256 </ ListItemIcon >
43- < ListItemText primary = { text === "Dashboard" ? "Validation" : text } />
57+ < ListItemText primary = { item . displayText } />
4458 </ ListItemButton >
4559 </ ListItem >
4660 ) ) }
You can’t perform that action at this time.
0 commit comments