generated from chingu-voyages/voyage-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.tsx
47 lines (45 loc) · 1.45 KB
/
App.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import GetRecipies from './components/AutoIngredientSearch'
import Header from './components/Header'
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'
import Register from './components/Register'
import Login from './components/Login'
import { FirebaseAuthProvider } from './FirebaseAuthContext'
import ProtectedRoute from './components/ProtectedRoute'
import RecipePage from './components/RecipePage'
import SavedRecipes from './components/SavedRecipes'
import AuthenticatedRoute from './components/AuthenticatedRoute'
function App() {
return (
<div id='app'>
<FirebaseAuthProvider>
<Router>
<Header />
<Routes>
<Route path='/' element={<GetRecipies />} />
<Route
path='/register'
element={
<ProtectedRoute redirectPath='/'>
<Register />
</ProtectedRoute>
}
/>
<Route
path='/login'
element={
<ProtectedRoute redirectPath='/'>
<Login />
</ProtectedRoute>
}
/>
<Route path='/:recipeId' element={<RecipePage />} />
<Route element={<AuthenticatedRoute />}>
<Route path='/saved-recipes' element={<SavedRecipes />} />
</Route>
</Routes>
</Router>
</FirebaseAuthProvider>
</div>
)
}
export default App