diff options
| author | Georgios Andreadis <info@gandreadis.com> | 2020-07-21 15:33:37 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-08-24 19:48:16 +0200 |
| commit | 912e1b96bfa7d6c022d854fa744f719b49ca98d0 (patch) | |
| tree | 49cdaf109aa08b0149c34174ce0f00c7056221ea /frontend/src/routes/index.js | |
| parent | 791b5d1e443f97adc756264878c3aae41ca0f748 (diff) | |
Add first plotting attempts for portfolios
Diffstat (limited to 'frontend/src/routes/index.js')
| -rw-r--r-- | frontend/src/routes/index.js | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/frontend/src/routes/index.js b/frontend/src/routes/index.js index 96f615b1..4291a046 100644 --- a/frontend/src/routes/index.js +++ b/frontend/src/routes/index.js @@ -7,7 +7,7 @@ import NotFound from '../pages/NotFound' import Profile from '../pages/Profile' import Projects from '../pages/Projects' -const ProtectedComponent = (component) => () => (userIsLoggedIn() ? component : <Redirect to="/"/>) +const ProtectedComponent = (component) => () => (userIsLoggedIn() ? component : <Redirect to="/" />) const AppComponent = ({ match }) => userIsLoggedIn() ? ( <App @@ -15,18 +15,24 @@ const AppComponent = ({ match }) => portfolioId={match.params.portfolioId} scenarioId={match.params.scenarioId} /> - ) : <Redirect to="/"/> + ) : ( + <Redirect to="/" /> + ) const Routes = () => ( <BrowserRouter> <Switch> - <Route exact path="/" component={Home}/> - <Route exact path="/projects" render={ProtectedComponent(<Projects/>)}/> - <Route exact path="/projects/:projectId" component={AppComponent}/> - <Route exact path="/projects/:projectId/portfolios/:portfolioId" component={AppComponent}/> - <Route exact path="/projects/:projectId/portfolios/:portfolioId/scenarios/:scenarioId" component={AppComponent}/> - <Route exact path="/profile" render={ProtectedComponent(<Profile/>)}/> - <Route path="/*" component={NotFound}/> + <Route exact path="/" component={Home} /> + <Route exact path="/projects" render={ProtectedComponent(<Projects />)} /> + <Route exact path="/projects/:projectId" component={AppComponent} /> + <Route exact path="/projects/:projectId/portfolios/:portfolioId" component={AppComponent} /> + <Route + exact + path="/projects/:projectId/portfolios/:portfolioId/scenarios/:scenarioId" + component={AppComponent} + /> + <Route exact path="/profile" render={ProtectedComponent(<Profile />)} /> + <Route path="/*" component={NotFound} /> </Switch> </BrowserRouter> ) |
