From 191ec6d655edd4f77ba40f3a42ae277ea769cc0a Mon Sep 17 00:00:00 2001 From: Desmond Kyeremeh Date: Fri, 2 Jul 2021 15:17:35 +0000 Subject: SideNav: updated url matching algorithm --- modern/src/components/SideNav.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'modern/src/components') 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)} > {route.icon} -- cgit v1.2.3