From 81856f7025a63b915db941a82aeaea7f4eb7195e Mon Sep 17 00:00:00 2001 From: Aleksandra Pawlak Date: Thu, 4 Mar 2021 19:55:31 +0100 Subject: [PATCH] Move routes to the dedicated file closes #70 --- client/src/components/App/index.js | 47 ++------------------- client/src/components/Loader/index.js | 7 ++++ client/src/components/Loader/style.scss | 5 +++ client/src/components/Routes/Routes.js | 56 +++++++++++++++++++++++++ 4 files changed, 72 insertions(+), 43 deletions(-) create mode 100644 client/src/components/Loader/index.js create mode 100644 client/src/components/Loader/style.scss create mode 100644 client/src/components/Routes/Routes.js diff --git a/client/src/components/App/index.js b/client/src/components/App/index.js index b8cca26..892adfa 100644 --- a/client/src/components/App/index.js +++ b/client/src/components/App/index.js @@ -1,48 +1,9 @@ -import './style.scss'; -import React, { Fragment } from 'react'; -import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'; -import Landing from '../../domain/Landing'; -import SignUp from '../../domain/Auth/SignUp'; -import Login from '../../domain/Auth/Login'; -import MovieList from '../../domain/MovieList'; -import Navbar from '../Navbar/index'; +import React from 'react'; -function App() { - return ( - - - -
- - - {/* http://localhost:3000/movies */} - - {/* http://localhost:3000/signup */} - - {/* http://localhost:3000/login */} - - {/* http://localhost:3000/logout */} - {/* */} - {/* http://localhost:3000/users/me */} - {/* */} - {/* http://localhost:3000/reservation/pre/:screeningId */} - {/* */} - {/* http://localhost:3000/reservation/chooseSeats/:screeningId */} - {/* */} - {/* http://localhost:3000/reservation/details/:reservationId */} - {/* */} - {/* http://localhost:3000/reservation/payment/:reservationId */} - {/* */} - {/* http://localhost:3000/reservation/confirm/:reservationId */} - {/* */} +import Routes from '../Routes/Routes.js'; - {/* */} - {/* http://localhost:3000/admin */} - -
-
-
- ); +function App() { + return ; } export default App; diff --git a/client/src/components/Loader/index.js b/client/src/components/Loader/index.js new file mode 100644 index 0000000..27a4c20 --- /dev/null +++ b/client/src/components/Loader/index.js @@ -0,0 +1,7 @@ +import './style.scss'; + +function Loader() { + return
To be continued...
; +} + +export default Loader; diff --git a/client/src/components/Loader/style.scss b/client/src/components/Loader/style.scss new file mode 100644 index 0000000..f849818 --- /dev/null +++ b/client/src/components/Loader/style.scss @@ -0,0 +1,5 @@ +@import '../../styles/variables'; +.loader { + background-color: $color-primary; + color: $text-color-secondary; +} diff --git a/client/src/components/Routes/Routes.js b/client/src/components/Routes/Routes.js new file mode 100644 index 0000000..961408b --- /dev/null +++ b/client/src/components/Routes/Routes.js @@ -0,0 +1,56 @@ +import '../App/style.scss'; +import React, { Fragment, lazy, Suspense } from 'react'; +import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'; +import Loader from '../Loader'; + +const Landing = lazy(() => import('../../domain/Landing')); + +const SignUp = lazy(() => import('../../domain/Auth/SignUp')); + +const Login = lazy(() => import('../../domain/Auth/Login')); + +const MovieList = lazy(() => import('../../domain/MovieList')); + +const Navbar = lazy(() => import('../Navbar/index')); + +function Routes() { + return ( + }> + + + +
+ + + {/* http://localhost:3000/movies */} + + {/* http://localhost:3000/signup */} + + {/* http://localhost:3000/login */} + + {/* http://localhost:3000/logout */} + {/* */} + {/* http://localhost:3000/users/me */} + {/* */} + {/* http://localhost:3000/reservation/pre/:screeningId */} + {/* */} + {/* http://localhost:3000/reservation/chooseSeats/:screeningId */} + {/* */} + {/* http://localhost:3000/reservation/details/:reservationId */} + {/* */} + {/* http://localhost:3000/reservation/payment/:reservationId */} + {/* */} + {/* http://localhost:3000/reservation/confirm/:reservationId */} + {/* */} + + {/* */} + {/* http://localhost:3000/admin */} + +
+
+
+
+ ); +} + +export default Routes;