@@ -12,13 +12,16 @@ import {
12
12
Toolbar ,
13
13
Typography ,
14
14
Tooltip ,
15
+ Badge ,
16
+ Chip ,
15
17
} from "@mui/material" ;
16
18
import MenuIcon from "@mui/icons-material/Menu" ;
17
19
import CloudIcon from "@mui/icons-material/Cloud" ;
18
20
import HomeIcon from "@mui/icons-material/Home" ;
19
21
import AssignmentIcon from "@mui/icons-material/Assignment" ;
20
22
import WorkspacesIcon from "@mui/icons-material/Workspaces" ;
21
23
24
+
22
25
// use relative path to load Logo
23
26
import volcanoLogo from "../assets/volcano-icon-color.svg" ;
24
27
@@ -50,6 +53,7 @@ const Layout = () => {
50
53
sx = { {
51
54
zIndex : ( theme ) => theme . zIndex . drawer + 1 ,
52
55
bgcolor : headerGrey ,
56
+ boxShadow : "0 2px 8px rgba(0,0,0,0.1)" , // Enhanced shadow
53
57
} }
54
58
>
55
59
< Toolbar >
@@ -62,17 +66,31 @@ const Layout = () => {
62
66
>
63
67
< MenuIcon />
64
68
</ IconButton >
65
- < Typography
66
- variant = "h6"
67
- noWrap
68
- component = "div"
69
- sx = { {
70
- color : "#ffffff" ,
71
- fontWeight : 500 ,
72
- } }
73
- >
74
- Volcano Dashboard
75
- </ Typography >
69
+
70
+ { /* Enhanced Logo Section */ }
71
+ < Box sx = { { display : "flex" , alignItems : "center" , gap : 2 } } >
72
+ < img
73
+ src = { volcanoLogo }
74
+ alt = "Volcano Logo"
75
+ style = { {
76
+ width : "32px" ,
77
+ height : "32px" ,
78
+ borderRadius : "6px"
79
+ } }
80
+ />
81
+ < Typography
82
+ variant = "h6"
83
+ noWrap
84
+ component = "div"
85
+ sx = { {
86
+ color : "#ffffff" ,
87
+ fontWeight : 600 ,
88
+ letterSpacing : "0.5px"
89
+ } }
90
+ >
91
+ Volcano Dashboard
92
+ </ Typography >
93
+ </ Box >
76
94
</ Toolbar >
77
95
</ AppBar >
78
96
@@ -85,51 +103,95 @@ const Layout = () => {
85
103
[ `& .MuiDrawer-paper` ] : {
86
104
width : open ? drawerWidth : 60 ,
87
105
boxSizing : "border-box" ,
88
- backgroundColor : "#f5f5f5" ,
106
+ backgroundColor : "#fafafa" , // Slightly lighter background
89
107
transition : "width 0.2s" ,
90
108
overflowX : "hidden" ,
91
109
display : "flex" ,
92
110
flexDirection : "column" ,
111
+ borderRight : "1px solid rgba(0,0,0,0.08)" , // Subtle border
112
+ boxShadow : "2px 0 8px rgba(0,0,0,0.05)" , // Subtle shadow
93
113
} ,
94
114
} }
95
115
>
96
116
< Toolbar />
97
- < Box sx = { { overflow : "hidden auto" , flexGrow : 1 } } >
117
+
118
+ { /* Enhanced Navigation Header */ }
119
+ { open && (
120
+ < Box sx = { { px : 2 , pt : 2 , pb : 1 } } >
121
+ < Typography
122
+ variant = "overline"
123
+ sx = { {
124
+ color : "text.secondary" ,
125
+ fontWeight : 600 ,
126
+ letterSpacing : "1px" ,
127
+ fontSize : "0.7rem"
128
+ } }
129
+ >
130
+ NAVIGATION
131
+ </ Typography >
132
+ </ Box >
133
+ ) }
134
+
135
+ < Box sx = { { overflow : "hidden auto" , flexGrow : 1 , px : 1 } } >
98
136
< List >
99
137
{ menuItems . map ( ( item ) => {
138
+ const isActive = location . pathname === item . path ;
139
+
100
140
const listItem = (
101
141
< ListItem
102
142
key = { item . text }
103
143
component = { Link }
104
144
to = { item . path }
105
- className = {
106
- location . pathname === item . path
107
- ? "active"
108
- : ""
109
- }
110
145
sx = { {
111
- "&.active" : {
112
- bgcolor : "rgba(0, 0, 0, 0.08) " ,
113
- "& .MuiListItemIcon-root" : {
114
- color : volcanoOrange ,
115
- } ,
116
- "& .MuiListItemText-primary" : {
117
- color : volcanoOrange ,
118
- fontWeight : 500 ,
119
- } ,
120
- } ,
146
+ color : "inherit" ,
147
+ textDecoration : "none " ,
148
+ borderRadius : 2 ,
149
+ mb : 0.5 ,
150
+ position : "relative" ,
151
+ minHeight : 48 ,
152
+ justifyContent : open ? "flex-start" : "center" ,
153
+ px : open ? 2 : 1 , // Better padding for centering
154
+ bgcolor : isActive ? ` ${ volcanoOrange } 15` : "transparent" ,
155
+ border : isActive ? `1px solid ${ volcanoOrange } 30` : "1px solid transparent" ,
121
156
"&:hover" : {
122
- backgroundColor :
123
- "rgba(0, 0, 0, 0.1)" ,
157
+ backgroundColor : isActive ? `${ volcanoOrange } 20` : "rgba(0, 0, 0, 0.04)" ,
124
158
} ,
159
+ "& .MuiListItemIcon-root" : {
160
+ color : isActive ? volcanoOrange : "text.secondary" ,
161
+ minWidth : 40 ,
162
+ justifyContent : "center" ,
163
+ mr : open ? 0 : 0 // Center icons when collapsed
164
+ } ,
165
+ "& .MuiListItemText-primary" : {
166
+ fontWeight : isActive ? 600 : 500 ,
167
+ color : isActive ? volcanoOrange : "text.primary" ,
168
+ fontSize : "0.9rem"
169
+ }
125
170
} }
126
171
>
127
172
< ListItemIcon > { item . icon } </ ListItemIcon >
128
173
{ open && (
129
174
< ListItemText primary = { item . text } />
130
175
) }
176
+
177
+ { /* Active indicator line */ }
178
+ { isActive && (
179
+ < Box
180
+ sx = { {
181
+ position : "absolute" ,
182
+ left : 0 ,
183
+ top : "50%" ,
184
+ transform : "translateY(-50%)" ,
185
+ width : 3 ,
186
+ height : 24 ,
187
+ bgcolor : volcanoOrange ,
188
+ borderRadius : "0 2px 2px 0"
189
+ } }
190
+ />
191
+ ) }
131
192
</ ListItem >
132
193
) ;
194
+
133
195
return ! open ? (
134
196
< Tooltip
135
197
key = { item . text }
@@ -146,47 +208,52 @@ const Layout = () => {
146
208
} ) }
147
209
</ List >
148
210
</ Box >
149
- { /* Logo and text part */ }
211
+
212
+ { /* Enhanced Logo section */ }
150
213
< Box
151
214
sx = { {
152
- p : 1 ,
215
+ p : open ? 2 : 1 ,
153
216
display : "flex" ,
154
217
flexDirection : "column" ,
155
218
justifyContent : "center" ,
156
219
alignItems : "center" ,
157
220
mt : "auto" ,
158
221
mb : 1 ,
159
- // borderTop: "1px solid rgba(0, 0, 0, 0.12 )",
222
+ borderTop : "1px solid rgba(0, 0, 0, 0.08 )" , // Subtle divider
160
223
} }
161
224
>
162
225
< img
163
226
src = { volcanoLogo }
164
227
alt = "Volcano Logo"
165
228
style = { {
166
- maxWidth : open ? "150px " : "60px" ,
229
+ maxWidth : open ? "120px " : "40px" , // Slightly smaller when expanded
167
230
height : "auto" ,
168
231
transition : "max-width 0.2s" ,
169
- marginBottom : "1px ",
232
+ marginBottom : open ? "8px" : "4px ",
170
233
} }
171
234
/>
172
- { /* {open && (
173
- <Typography
174
- sx={{
175
- fontWeight: 700,
176
- color: "#000",
177
- fontSize: "1.4rem",
178
- letterSpacing: "0.1em",
179
- mt: -6,
180
- }}
181
- >
182
- VOLCANO
183
- </Typography>
184
- )} */ }
235
+ { open && (
236
+ < Typography
237
+ variant = "caption"
238
+ sx = { {
239
+ color : "text.secondary" ,
240
+ fontWeight : 500 ,
241
+ textAlign : "center"
242
+ } }
243
+ >
244
+ v1.0.0
245
+ </ Typography >
246
+ ) }
185
247
</ Box >
186
248
</ Drawer >
249
+
187
250
< Box
188
251
component = "main"
189
- sx = { { flexGrow : 1 , p : 3 , backgroundColor : "white" } }
252
+ sx = { {
253
+ flexGrow : 1 ,
254
+ p : 3 ,
255
+ backgroundColor : "#fafafa" // Consistent background
256
+ } }
190
257
>
191
258
< Toolbar />
192
259
< Outlet />
@@ -195,4 +262,4 @@ const Layout = () => {
195
262
) ;
196
263
} ;
197
264
198
- export default Layout ;
265
+ export default Layout ;
0 commit comments