diff options
author | Desmond Kyeremeh <elDekyfin@gmail.com> | 2021-07-02 15:17:35 +0000 |
---|---|---|
committer | Desmond Kyeremeh <elDekyfin@gmail.com> | 2021-07-02 15:17:35 +0000 |
commit | 191ec6d655edd4f77ba40f3a42ae277ea769cc0a (patch) | |
tree | ca6aa5b998a7f55789c874dfbb4d42bbf470723f /modern/src/components | |
parent | 7704d0f907c1567888a7d908a4641edfec0e68f4 (diff) | |
download | etbsa-traccar-web-191ec6d655edd4f77ba40f3a42ae277ea769cc0a.tar.gz etbsa-traccar-web-191ec6d655edd4f77ba40f3a42ae277ea769cc0a.tar.bz2 etbsa-traccar-web-191ec6d655edd4f77ba40f3a42ae277ea769cc0a.zip |
SideNav: updated url matching algorithm
Diffstat (limited to 'modern/src/components')
-rw-r--r-- | modern/src/components/SideNav.js | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/modern/src/components/SideNav.js b/modern/src/components/SideNav.js index 669c79a..8bd43ac 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} /> |