-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
62 lines (58 loc) · 1.71 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import { ReactElement } from 'react';
import { BrowserRouter as Router, Route, Routes } from 'react-router-dom';
import Login from './src/components/Auth/Login';
import Signup from './src/components/Auth/Signup';
import Dashboard from './src/components/Dashboard/Home';
import Onboarding from './src/components/Dashboard/Onboarding';
import NotificationBanner from './src/components/Shared/NotificationBanner';
import PublicRoute from './src/components/Shared/Router/public-route';
import PrivateRoute from './src/components/Shared/Router/private-route';
import ErrorBoundary from './src/components/Shared/ErrorBoundary';
import GlobalStyles from './src/components/Shared/GlobalStyles';
function App(): ReactElement {
return (
<>
<GlobalStyles />
<NotificationBanner />
<Router>
<ErrorBoundary link="/">
<Routes>
<Route
path="/"
element={
<PublicRoute>
<Login />
</PublicRoute>
}
/>
<Route
path="/signup"
element={
<PublicRoute>
<Signup />
</PublicRoute>
}
/>
<Route
path="/dashboard"
element={
<PrivateRoute>
<Dashboard />
</PrivateRoute>
}
/>
<Route
path="/dashboard/onboarding"
element={
<PrivateRoute>
<Onboarding />
</PrivateRoute>
}
/>
</Routes>
</ErrorBoundary>
</Router>
</>
);
}
export default App;