From 90fae26aa4bd0e0eb3272ff6e6524060e9004fbb Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Mon, 29 Jun 2020 15:47:09 +0200 Subject: Prepare frontend repository for monorepo This change prepares the frontend Git repository for the monorepo residing at https://github.com/atlarge-research.com/opendc. To accomodate for this, we move all files into a frontend subdirectory. --- frontend/src/routes/index.js | 64 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 frontend/src/routes/index.js (limited to 'frontend/src/routes/index.js') diff --git a/frontend/src/routes/index.js b/frontend/src/routes/index.js new file mode 100644 index 00000000..f7523458 --- /dev/null +++ b/frontend/src/routes/index.js @@ -0,0 +1,64 @@ +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"; + +const ProtectedComponent = component => () => + userIsLoggedIn() ? component : ; +const AppComponent = ({ match }) => + userIsLoggedIn() ? ( + + ) : ( + + ); + +const ExperimentsComponent = ({ match }) => + userIsLoggedIn() ? ( + + ) : ( + + ); + +const SimulationComponent = ({ match }) => + userIsLoggedIn() ? ( + + ) : ( + + ); + +const Routes = () => ( + + + + )} + /> + + + + )} /> + + + +); + +export default Routes; -- cgit v1.2.3