Created
October 6, 2024 11:59
-
-
Save paulweezydesign/a44ddce2889aeeb0be34d56ccf27b7b4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { BrowserRouter, Routes, Route } from 'react-router-dom'; | |
import { AuthProvider } from './components/AuthProvider'; | |
import { ProtectedRoute } from './components/ProtectedRoute'; | |
import { Login } from './components/Login'; | |
import { Signup } from './components/Signup'; | |
import { Dashboard } from './components/Dashboard'; | |
function App() { | |
return ( | |
<BrowserRouter> | |
<AuthProvider> | |
<Routes> | |
<Route path="/login" element={<Login />} /> | |
<Route path="/signup" element={<Signup />} /> | |
<Route | |
path="/dashboard" | |
element={ | |
<ProtectedRoute> | |
<Dashboard /> | |
</ProtectedRoute> | |
} | |
/> | |
<Route path="/" element={<Login />} /> | |
</Routes> | |
</AuthProvider> | |
</BrowserRouter> | |
); | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment