From fe59b0c854632d9c76df30f95af2d23feeea6dea Mon Sep 17 00:00:00 2001 From: Matthew Northcott Date: Fri, 3 Feb 2023 14:36:04 +1300 Subject: [PATCH] [#40] Implement router --- frontend/src/App.js | 23 ----------------------- frontend/src/App.test.js | 8 -------- frontend/src/index.js | 27 +++++++++++++++++++++++---- frontend/src/pages/RegisterPage.jsx | 5 +++++ 4 files changed, 28 insertions(+), 35 deletions(-) delete mode 100644 frontend/src/App.js delete mode 100644 frontend/src/App.test.js create mode 100644 frontend/src/pages/RegisterPage.jsx diff --git a/frontend/src/App.js b/frontend/src/App.js deleted file mode 100644 index ce42bdb..0000000 --- a/frontend/src/App.js +++ /dev/null @@ -1,23 +0,0 @@ -import MainPage from './pages/MainPage'; -import { createTheme, ThemeProvider } from '@mui/material/styles'; - -function App() { - const darkTheme = createTheme({ - palette: { - mode: 'dark', - }, - typography: { - fontFamily: 'Poppins, sans-serif', - }, - }); - - return ( -
- - - -
- ); -} - -export default App; diff --git a/frontend/src/App.test.js b/frontend/src/App.test.js deleted file mode 100644 index 1f03afe..0000000 --- a/frontend/src/App.test.js +++ /dev/null @@ -1,8 +0,0 @@ -import { render, screen } from '@testing-library/react'; -import App from './App'; - -test('renders learn react link', () => { - render(); - const linkElement = screen.getByText(/learn react/i); - expect(linkElement).toBeInTheDocument(); -}); diff --git a/frontend/src/index.js b/frontend/src/index.js index fbb8810..f67b23a 100644 --- a/frontend/src/index.js +++ b/frontend/src/index.js @@ -1,26 +1,45 @@ import React from 'react'; import ReactDOM from 'react-dom'; -import App from './App'; +import { createTheme, ThemeProvider } from '@mui/material/styles'; import reportWebVitals from './reportWebVitals'; import { createBrowserRouter, RouterProvider, } from 'react-router-dom'; +import MainPage from './pages/MainPage'; // Styles import './assets/styles/main.scss'; import 'bootstrap/dist/css/bootstrap.min.css'; +import RegisterPage from './pages/RegisterPage'; const router = createBrowserRouter([ { path: "/", - element: + element: , }, -]) + { + path: "/register", + element: , + }, +]); + +const darkTheme = createTheme({ + palette: { + mode: 'dark', + }, + typography: { + fontFamily: 'Poppins, sans-serif', + }, +}); ReactDOM.render( - +
+ + + +
, document.getElementById('root') ); diff --git a/frontend/src/pages/RegisterPage.jsx b/frontend/src/pages/RegisterPage.jsx new file mode 100644 index 0000000..1cd579e --- /dev/null +++ b/frontend/src/pages/RegisterPage.jsx @@ -0,0 +1,5 @@ +const RegisterPage = () => { + return <>; +}; + +export default RegisterPage;