Created
August 9, 2022 11:02
-
-
Save zinedkaloc/a3c69200e7a1a5052824e3a258aee4d6 to your computer and use it in GitHub Desktop.
This file contains 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 { BrowserRouter, Routes, Route } from 'react-router-dom'; | |
import { Home } from './components/Home'; | |
import { Signup } from './components/Signup'; | |
import { Verification } from './components/Verification'; | |
import { Redirect } from './components/Redirect'; | |
import { Login } from './components/Login'; | |
import { PrivateRoute } from './components/PrivateRoute'; | |
import { AuthProvider } from './contexts/Auth'; | |
import { Profile } from './components/Profile'; | |
export default function App() { | |
return ( | |
<div> | |
<BrowserRouter> | |
<AuthProvider> | |
<Routes> | |
<Route | |
path="/" | |
element={ | |
<PrivateRoute> | |
<Home /> | |
</PrivateRoute> | |
} | |
/> | |
<Route | |
path="/profile" | |
element={ | |
<PrivateRoute> | |
<Profile /> | |
</PrivateRoute> | |
} | |
/> | |
<Route path="/signup" element={<Signup />} /> | |
<Route path="/auth-redirect" element={<Redirect />} /> | |
<Route path="/verification" element={<Verification />} /> | |
<Route path="/login" element={<Login />} /> | |
</Routes> | |
</AuthProvider> | |
</BrowserRouter> | |
</div> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment