Skip to content

Commit 3bd9175

Browse files
Update Management sidebar.js
1 parent 594066a commit 3bd9175

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,6 @@ ENV/
109109
# SQLite data
110110
flask-backend/api/db.sqlite3
111111
*.db
112+
113+
# Misc
114+
.DS_Store

React-frontend/src/components/Management/Sidebar.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ function Sidebar() {
112112

113113
// Other items
114114
const otherItems = [
115-
['Home', <HomeIcon color="secondary"/>],
116-
['Contact', <ContactSupportIcon color="secondary"/>],
117-
['About', <InfoIcon color="secondary"/>]
115+
['Home', <HomeIcon color="secondary"/>, "/"],
116+
['Contact', <ContactSupportIcon color="secondary"/>, "/contact"],
117+
['About', <InfoIcon color="secondary"/>, "/about"]
118118
]
119119

120120
return (
@@ -202,10 +202,16 @@ function Sidebar() {
202202
<Divider />
203203
<List>
204204
{otherItems.map((item, index) => (
205-
<ListItem button key={item[0]}>
206-
<ListItemIcon>{item[1]}</ListItemIcon>
207-
<ListItemText primary={item[0]}/>
208-
</ListItem>
205+
<ListItem
206+
button key={item[0]}
207+
className={
208+
(location.pathname === item[2]) ? classes.activeItem : null}
209+
onClick={() => history.push(item[2])
210+
}
211+
>
212+
<ListItemIcon>{item[1]}</ListItemIcon>
213+
<ListItemText primary={item[0]} />
214+
</ListItem>
209215
))}
210216
</List>
211217

0 commit comments

Comments
 (0)