diff options
| author | Georgios Andreadis <info@gandreadis.com> | 2020-07-07 09:55:10 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-08-24 19:47:25 +0200 |
| commit | b4bdf9fde013bb7ff9579693b64ff575f7b00e44 (patch) | |
| tree | 5e05ceba918849391a639bbeeab37d290a86523c /frontend/src/routes | |
| parent | 7331e9baf2cfe7bdfb24effcf0a4801da1e7ea4d (diff) | |
Rename simulations to projects and remove experiment view
Diffstat (limited to 'frontend/src/routes')
| -rw-r--r-- | frontend/src/routes/index.js | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/frontend/src/routes/index.js b/frontend/src/routes/index.js index ea703567..d3f50be5 100644 --- a/frontend/src/routes/index.js +++ b/frontend/src/routes/index.js @@ -2,36 +2,23 @@ import React from 'react' import { BrowserRouter, Redirect, Route, Switch } from 'react-router-dom' import { userIsLoggedIn } from '../auth/index' import App from '../pages/App' -import Experiments from '../pages/Experiments' import Home from '../pages/Home' import NotFound from '../pages/NotFound' import Profile from '../pages/Profile' -import Simulations from '../pages/Simulations' +import Projects from '../pages/Projects' -const ProtectedComponent = (component) => () => (userIsLoggedIn() ? component : <Redirect to="/" />) +const ProtectedComponent = (component) => () => (userIsLoggedIn() ? component : <Redirect to="/"/>) const AppComponent = ({ match }) => - userIsLoggedIn() ? <App simulationId={match.params.simulationId} /> : <Redirect to="/" /> - -const ExperimentsComponent = ({ match }) => - userIsLoggedIn() ? <Experiments simulationId={match.params.simulationId} /> : <Redirect to="/" /> - -const SimulationComponent = ({ match }) => - userIsLoggedIn() ? ( - <App simulationId={match.params.simulationId} inSimulation={true} experimentId={match.params.experimentId} /> - ) : ( - <Redirect to="/" /> - ) + userIsLoggedIn() ? <App projectId={match.params.projectId}/> : <Redirect to="/"/> const Routes = () => ( <BrowserRouter> <Switch> - <Route exact path="/" component={Home} /> - <Route exact path="/simulations" render={ProtectedComponent(<Simulations />)} /> - <Route exact path="/simulations/:simulationId" component={AppComponent} /> - <Route exact path="/simulations/:simulationId/experiments" component={ExperimentsComponent} /> - <Route exact path="/simulations/:simulationId/experiments/:experimentId" component={SimulationComponent} /> - <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="/profile" render={ProtectedComponent(<Profile/>)}/> + <Route path="/*" component={NotFound}/> </Switch> </BrowserRouter> ) |
