aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Joe Banks <[email protected]>2024-08-17 02:05:37 +0100
committerGravatar Joe Banks <[email protected]>2024-08-17 02:05:37 +0100
commit79f6dfd5214718cd83da296a687b715fa6632ad0 (patch)
treea8d6c1cead382c60fd5b15e11d502386457c636f
parentAdd react-router (diff)
Add react-router to main app
-rw-r--r--thallium-frontend/src/App.tsx22
1 files changed, 19 insertions, 3 deletions
diff --git a/thallium-frontend/src/App.tsx b/thallium-frontend/src/App.tsx
index 14731f4..d58e34e 100644
--- a/thallium-frontend/src/App.tsx
+++ b/thallium-frontend/src/App.tsx
@@ -1,10 +1,17 @@
import styled, { createGlobalStyle, ThemeProvider } from 'styled-components';
-
-import LandingPage from "./pages/LandingPage"
import { useEffect, useState } from 'react';
+import {
+ createBrowserRouter,
+ RouterProvider,
+} from "react-router-dom";
import themes from './themes.tsx';
+import Header from "./components/Header";
+
+import LandingPage from "./pages/LandingPage"
+import ErrorPage from "./pages/ErrorPage"
+
const GlobalStyle = createGlobalStyle`
html,
@@ -46,6 +53,14 @@ const ContentContainer = styled.div`
padding: 1rem;
`;
+const router = createBrowserRouter([
+ {
+ path: "/",
+ element: <LandingPage />,
+ errorElement: <ErrorPage />,
+ },
+]);
+
function App() {
const [isDarkMode, setIsDarkMode] = useState(false);
@@ -65,7 +80,8 @@ function App() {
<AppContainer>
<GlobalStyle />
<ContentContainer>
- <LandingPage />
+ <Header />
+ <RouterProvider router={router} />
</ContentContainer>
<BodySeparator />