diff options
author | Jeff <jeffkleinaitis@gmail.com> | 2024-04-11 23:07:32 -0400 |
---|---|---|
committer | Jeff <jeffkleinaitis@gmail.com> | 2024-04-11 23:07:32 -0400 |
commit | cf39c673da5a2785943109de5c9172d5c607a5ea (patch) | |
tree | 0f0a55d6a719b9864b2eb9e8264f0edfc0dbe0bc /src/App.js | |
parent | 8fffadc92cc851dbba26dc7ac4c5ea03d9ad16df (diff) |
feat: Implement React context for authorization
Diffstat (limited to 'src/App.js')
-rw-r--r-- | src/App.js | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useState } from 'react'; import { BrowserRouter as Router, Routes, Route, useLocation } from 'react-router-dom'; import Navbar from './components/Navbar'; import Footer from './components/Footer'; @@ -13,14 +13,17 @@ import Careers from "./pages/Careers"; import HelpCenter from "./pages/HelpCenter"; import TermsOfService from "./pages/TermsOfService"; import PrivacyPolicy from "./pages/PrivacyPolicy"; +import Dashboard from "./pages/Dashboard"; +import {AuthProvider} from "./providers/AuthContext"; function App() { const location = useLocation(); const excludedRoutes = ['/login', '/sign-up', '/forgot-password']; return ( + <AuthProvider> <div className="App"> - {!excludedRoutes.includes(location.pathname) && <Navbar />} + {!excludedRoutes.includes(location.pathname) && <Navbar />} <Routes> <Route path="/" element={<Home />} /> <Route path="/about" element={<About />} /> @@ -30,12 +33,14 @@ function App() { <Route path="/terms-of-service" element={<TermsOfService />} /> <Route path="/privacy-policy" element={<PrivacyPolicy />} /> <Route path="/login" element={<Login />} /> + <Route path="/dashboard" element={<Dashboard />} /> <Route path="/forgot-password" element={<ForgotPassword />} /> <Route path="/sign-up" element={<SignUp />} /> </Routes> {!excludedRoutes.includes(location.pathname) && <Footer />} {!excludedRoutes.includes(location.pathname) && <PopupWidget />} </div> + </AuthProvider> ); } |