From 6adeb8dda4f4a127b87fb6769e5b5ffdac92ec87 Mon Sep 17 00:00:00 2001 From: Aymeric Chaumont <aymeric.chaumont@student-cs.fr> Date: Tue, 5 Jul 2022 09:17:06 +0200 Subject: [PATCH] restructuring file architecture --- frontend/src/App.css | 21 --------------- frontend/src/App.js | 25 ----------------- frontend/src/components/Footer.js | 2 +- frontend/src/components/Timetable.js | 2 +- frontend/src/index.js | 27 ++++++++++++++++++- .../src/{components => styles}/Footer.css | 0 .../src/{components => styles}/Header.css | 0 .../src/{components => styles}/Timetable.css | 0 frontend/src/styles/index.css | 7 +++++ frontend/src/views/index.js | 1 - 10 files changed, 35 insertions(+), 50 deletions(-) delete mode 100644 frontend/src/App.css delete mode 100644 frontend/src/App.js rename frontend/src/{components => styles}/Footer.css (100%) rename frontend/src/{components => styles}/Header.css (100%) rename frontend/src/{components => styles}/Timetable.css (100%) create mode 100644 frontend/src/styles/index.css diff --git a/frontend/src/App.css b/frontend/src/App.css deleted file mode 100644 index 23d7f20..0000000 --- a/frontend/src/App.css +++ /dev/null @@ -1,21 +0,0 @@ -html, -body { - height: 100%; - color: white; - text-align: center; -} - -/* Demo styling */ - -body { - background: #4568DC; - background: -webkit-linear-gradient(to right, #B06AB3, #4568DC); - background: linear-gradient(to right, #B06AB3, #4568DC); -} - -code { - color: #665; - background: #fff; - padding: 0.2rem; - border-radius: 0.2rem; -} \ No newline at end of file diff --git a/frontend/src/App.js b/frontend/src/App.js deleted file mode 100644 index 144eaea..0000000 --- a/frontend/src/App.js +++ /dev/null @@ -1,25 +0,0 @@ -import React from "react" -import {BrowserRouter as Router, Routes, Route } from 'react-router-dom' - -import { Header, Footer } from "./components" -import { HomePage, Eiffel, NotFoundPage } from "./views" - -import 'bootstrap/dist/css/bootstrap.min.css'; -import styles from "./App.css" - - -export default function App() { - return ( - <div className="App"> - <Router> - <Header /> - <Routes> - <Route exact path='/' element={<HomePage />}/> - <Route path='/eiffel' element={<Eiffel />}/> - <Route path='/*' element={<NotFoundPage />}/> - </Routes> - <Footer /> - </Router> - </div> - ) -} \ No newline at end of file diff --git a/frontend/src/components/Footer.js b/frontend/src/components/Footer.js index ed3ec40..df100b0 100644 --- a/frontend/src/components/Footer.js +++ b/frontend/src/components/Footer.js @@ -1,6 +1,6 @@ import React from "react" -import styles from "./Footer.css" +import styles from "../styles/Footer.css" export default function Footer() { diff --git a/frontend/src/components/Timetable.js b/frontend/src/components/Timetable.js index 7a99a7c..23a123a 100644 --- a/frontend/src/components/Timetable.js +++ b/frontend/src/components/Timetable.js @@ -1,7 +1,7 @@ import React from "react" import Table from "react-bootstrap/Table" -import styles from "./Timetable.css" +import styles from "../styles/Timetable.css" export default function Timetable (schedule) { diff --git a/frontend/src/index.js b/frontend/src/index.js index c96d624..95eeb67 100644 --- a/frontend/src/index.js +++ b/frontend/src/index.js @@ -1,6 +1,31 @@ import React from "react" import ReactDOM from "react-dom" -import { App } from "./views" +import {BrowserRouter as Router, Routes, Route } from 'react-router-dom' + +import { Header, Footer } from "./components" +import { HomePage, Eiffel, NotFoundPage } from "./views" + +import 'bootstrap/dist/css/bootstrap.min.css'; +import styles from "./styles/index.css" + + +export default function App() { + return ( + <div className="App"> + <Router> + <Header /> + <Routes> + <Route exact path='/' element={<HomePage />}/> + <Route path='/eiffel' element={<Eiffel />}/> + <Route path='/*' element={<NotFoundPage />}/> + </Routes> + <Footer /> + </Router> + </div> + ) +} + + ReactDOM.render( <React.StrictMode> <App /> diff --git a/frontend/src/components/Footer.css b/frontend/src/styles/Footer.css similarity index 100% rename from frontend/src/components/Footer.css rename to frontend/src/styles/Footer.css diff --git a/frontend/src/components/Header.css b/frontend/src/styles/Header.css similarity index 100% rename from frontend/src/components/Header.css rename to frontend/src/styles/Header.css diff --git a/frontend/src/components/Timetable.css b/frontend/src/styles/Timetable.css similarity index 100% rename from frontend/src/components/Timetable.css rename to frontend/src/styles/Timetable.css diff --git a/frontend/src/styles/index.css b/frontend/src/styles/index.css new file mode 100644 index 0000000..c465979 --- /dev/null +++ b/frontend/src/styles/index.css @@ -0,0 +1,7 @@ +body { + height: 100%; + color: white; + text-align: center; + background: linear-gradient(to right, #B06AB3, #4568DC); +} + diff --git a/frontend/src/views/index.js b/frontend/src/views/index.js index 2a745cc..bcf00a8 100644 --- a/frontend/src/views/index.js +++ b/frontend/src/views/index.js @@ -1,4 +1,3 @@ export { default as HomePage } from "./HomePage" export { default as Eiffel } from "./Eiffel" export { default as NotFoundPage } from "./NotFoundPage" -export { default as App } from "../App" -- GitLab