From 751a9ef3a12c952fe179f256d854d0c4aa37e28e Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Wed, 4 Oct 2017 22:49:07 +0200 Subject: Apply prettier to codebase --- src/routes/index.js | 76 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 49 insertions(+), 27 deletions(-) (limited to 'src/routes') diff --git a/src/routes/index.js b/src/routes/index.js index 96ac885c..f7523458 100644 --- a/src/routes/index.js +++ b/src/routes/index.js @@ -1,6 +1,6 @@ -import React from 'react'; -import {BrowserRouter, Redirect, Route, Switch} from "react-router-dom"; -import {userIsLoggedIn} from "../auth/index"; +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"; @@ -8,35 +8,57 @@ import NotFound from "../pages/NotFound"; import Profile from "../pages/Profile"; import Simulations from "../pages/Simulations"; -const ProtectedComponent = (component) => () => userIsLoggedIn() ? component : ; -const AppComponent = ({match}) => userIsLoggedIn() ? - : - ; +const ProtectedComponent = component => () => + userIsLoggedIn() ? component : ; +const AppComponent = ({ match }) => + userIsLoggedIn() ? ( + + ) : ( + + ); -const ExperimentsComponent = ({match}) => userIsLoggedIn() ? - : - ; +const ExperimentsComponent = ({ match }) => + userIsLoggedIn() ? ( + + ) : ( + + ); -const SimulationComponent = ({match}) => userIsLoggedIn() ? +const SimulationComponent = ({ match }) => + userIsLoggedIn() ? ( : - ; + simulationId={parseInt(match.params.simulationId, 10)} + inSimulation={true} + experimentId={parseInt(match.params.experimentId, 10)} + /> + ) : ( + + ); const Routes = () => ( - - - - )}/> - - - - )}/> - - - + + + + )} + /> + + + + )} /> + + + ); export default Routes; -- cgit v1.2.3