menu item highlighting

This commit is contained in:
MichaelDvP
2020-08-19 08:40:43 +02:00
parent a15e1834f5
commit 6065248f94
2 changed files with 3 additions and 3 deletions

View File

@@ -16,13 +16,13 @@ class ProjectMenu extends Component<ProjectProps> {
const path = this.props.match.url; const path = this.props.match.url;
return ( return (
<List> <List>
<ListItem to='/ems-esp/status/' selected={path.startsWith('/ems-esp/status/')} button component={Link}> <ListItem to='/ems-esp/' selected={path.startsWith('/ems-esp/status') || path.startsWith('/ems-esp/devices') || path.startsWith('/ems-esp/help')} button component={Link}>
<ListItemIcon> <ListItemIcon>
<SettingsRemoteIcon /> <SettingsRemoteIcon />
</ListItemIcon> </ListItemIcon>
<ListItemText primary="Dashboard" /> <ListItemText primary="Dashboard" />
</ListItem> </ListItem>
<ListItem to='/ems-esp/settings/' selected={path.startsWith('/ems-esp/settings/')} button component={Link} disabled={!authenticatedContext.me.admin}> <ListItem to='/ems-esp/settings' selected={path.startsWith('/ems-esp/settings')} button component={Link} disabled={!authenticatedContext.me.admin}>
<ListItemIcon> <ListItemIcon>
<SettingsIcon /> <SettingsIcon />
</ListItemIcon> </ListItemIcon>

View File

@@ -20,7 +20,7 @@ class ProjectRouting extends Component {
* The "to" property must match one of the routes above for this to work correctly. * The "to" property must match one of the routes above for this to work correctly.
*/ */
} }
<Redirect to={`/ems-esp/status/`} /> <Redirect to={`/ems-esp/status`} />
</Switch> </Switch>
) )
} }