diff options
| author | jc0b <j@jc0b.computer> | 2020-07-10 15:18:49 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-08-24 19:48:02 +0200 |
| commit | d8479e7e3744b8d1d31ac4d9f972e560eacd2cf8 (patch) | |
| tree | 79b7dfccec6e3cc1fce189b4605a37b354d676a2 /frontend/src/routes | |
| parent | 4befa57993831274ad7e6ca62f96aa582f81cc5d (diff) | |
| parent | 3b4e27320c479bd6ef48998f448ed070e8bd7511 (diff) | |
Merge branch 'master' of github.com:atlarge-research/opendc-dev
Diffstat (limited to 'frontend/src/routes')
| -rw-r--r-- | frontend/src/routes/index.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/frontend/src/routes/index.js b/frontend/src/routes/index.js index d3f50be5..96f615b1 100644 --- a/frontend/src/routes/index.js +++ b/frontend/src/routes/index.js @@ -9,7 +9,13 @@ import Projects from '../pages/Projects' const ProtectedComponent = (component) => () => (userIsLoggedIn() ? component : <Redirect to="/"/>) const AppComponent = ({ match }) => - userIsLoggedIn() ? <App projectId={match.params.projectId}/> : <Redirect to="/"/> + userIsLoggedIn() ? ( + <App + projectId={match.params.projectId} + portfolioId={match.params.portfolioId} + scenarioId={match.params.scenarioId} + /> + ) : <Redirect to="/"/> const Routes = () => ( <BrowserRouter> @@ -17,6 +23,8 @@ const Routes = () => ( <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> |
