fix appmenu highlighting

This commit is contained in:
proddy
2020-07-17 21:21:57 +02:00
parent abbe6296ea
commit 0475211040
4 changed files with 7 additions and 10 deletions

View File

@@ -1,7 +1,6 @@
import React, { Component } from 'react';
import { Redirect, Switch } from 'react-router';
import { PROJECT_PATH } from '../api';
import { AuthenticatedRoute } from '../authentication';
import EMSESP from './EMSESP';
@@ -12,17 +11,16 @@ class ProjectRouting extends Component {
render() {
return (
<Switch>
<AuthenticatedRoute exact path="/ems-esp/status" component={EMSESP} />
<AuthenticatedRoute exact path="/ems-esp/status/*" component={EMSESP} />
<AuthenticatedRoute exact path="/ems-esp/settings" component={EMSESPSettings} />
<AuthenticatedRoute exact path="/ems-esp/*" component={EMSESP} />
{
/*
* The redirect below caters for the default project route and redirecting invalid paths.
* The "to" property must match one of the routes above for this to work correctly.
*/
}
<Redirect to={`/${PROJECT_PATH}/status`} />
<Redirect to={`/ems-esp/status/`} />
</Switch>
)
}