mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 08:19:52 +03:00
menu item highlighting
This commit is contained in:
@@ -16,13 +16,13 @@ class ProjectMenu extends Component<ProjectProps> {
|
||||
const path = this.props.match.url;
|
||||
return (
|
||||
<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>
|
||||
<SettingsRemoteIcon />
|
||||
</ListItemIcon>
|
||||
<ListItemText primary="Dashboard" />
|
||||
</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>
|
||||
<SettingsIcon />
|
||||
</ListItemIcon>
|
||||
|
||||
@@ -20,7 +20,7 @@ class ProjectRouting extends Component {
|
||||
* 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>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user