aboutsummaryrefslogtreecommitdiff
path: root/modern/src/components/SideNav.js
diff options
context:
space:
mode:
authorDesmond Kyeremeh <elDekyfin@gmail.com>2021-07-02 15:17:35 +0000
committerDesmond Kyeremeh <elDekyfin@gmail.com>2021-07-02 15:17:35 +0000
commit191ec6d655edd4f77ba40f3a42ae277ea769cc0a (patch)
treeca6aa5b998a7f55789c874dfbb4d42bbf470723f /modern/src/components/SideNav.js
parent7704d0f907c1567888a7d908a4641edfec0e68f4 (diff)
downloadtrackermap-web-191ec6d655edd4f77ba40f3a42ae277ea769cc0a.tar.gz
trackermap-web-191ec6d655edd4f77ba40f3a42ae277ea769cc0a.tar.bz2
trackermap-web-191ec6d655edd4f77ba40f3a42ae277ea769cc0a.zip
SideNav: updated url matching algorithm
Diffstat (limited to 'modern/src/components/SideNav.js')
-rw-r--r--modern/src/components/SideNav.js11
1 files changed, 2 insertions, 9 deletions
diff --git a/modern/src/components/SideNav.js b/modern/src/components/SideNav.js
index 669c79ad..8bd43ac2 100644
--- a/modern/src/components/SideNav.js
+++ b/modern/src/components/SideNav.js
@@ -1,12 +1,5 @@
import React from 'react';
-import {
- List,
- ListItem,
- ListItemText,
- ListItemIcon,
- Divider,
- ListSubheader
-} from '@material-ui/core';
+import { List, ListItem, ListItemText, ListItemIcon, Divider, ListSubheader } from '@material-ui/core';
import { Link, useLocation } from 'react-router-dom';
const SideNav = ({ routes }) => {
@@ -27,7 +20,7 @@ const SideNav = ({ routes }) => {
key={route.href || route.subheader}
button
to={route.href}
- selected={route.href === location.pathname}
+ selected={location.pathname.match(route.match || route.href)}
>
<ListItemIcon>{route.icon}</ListItemIcon>
<ListItemText primary={route.name} />