forked from reduxjs/redux-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
34 lines (30 loc) · 762 Bytes
/
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
import { Routes, Route } from 'react-router-dom'
import { Box, Center, VStack } from '@chakra-ui/react'
import { Login } from './features/auth/Login'
import { PrivateOutlet } from './utils/PrivateOutlet'
import { ProtectedComponent } from './features/auth/ProtectedComponent'
function Hooray() {
return (
<Center h="500px">
<VStack>
<Box>Hooray you logged in!</Box>
<Box>
<ProtectedComponent />
</Box>
</VStack>
</Center>
)
}
function App() {
return (
<Box>
<Routes>
<Route path="/login" element={<Login />} />
<Route path="*" element={<PrivateOutlet />}>
<Route index element={<Hooray />} />
</Route>
</Routes>
</Box>
)
}
export default App