-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathRoutes.tsx
204 lines (202 loc) · 6.63 KB
/
Routes.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
/* eslint-disable */
import React, { Suspense } from 'react';
import { Outlet, Route, Routes } from 'react-router-dom';
import Footer from '../components/Footer';
import Header from '../components/Header';
import Skeleton from '../components/Skeleton';
import Home from '../pages/Home';
import Message from '../pages/Organization/Message';
import UserRegister from '../pages/Organization/UserRegister';
import Error from './../pages/Error';
/* istanbul ignore next */
const OrgRegister = React.lazy(() => import('../pages/OrgRegister'));
/* istanbul ignore next */
const Orglogin = React.lazy(() => import('../pages/Organization/Orglogin'));
/* istanbul ignore next */
const ResetPassword = React.lazy(() => import('../pages/ResetPassword'));
/* istanbul ignore next */
const ForgotPassword = React.lazy(() => import('../pages/ForgotPassword'));
/* istanbul ignore next */
const Adminlogin = React.lazy(() => import('../pages/Organization/AdminLogin'));
/* istanbul ignore next */
const Pricing = React.lazy(() => import('../pages/Pricing'));
/* istanbul ignore next */
const About = React.lazy(() => import('../pages/Comingsoon'));
const Community = React.lazy(() => import('../pages/Community'));
/* istanbul ignore next */
const Product = React.lazy(() => import('../pages/Comingsoon'));
const ContactUs = React.lazy(() => import('../pages/ContactUs'));
/* istanbul ignore next */
const SignupOrgDocs = React.lazy(
() => import('../components/Docs/SignupOrgDocs'),
);
/* istanbul ignore next */
const SigninOrgDocs = React.lazy(
() => import('../components/Docs/SigninOrgDocs'),
);
const UsersDocs = React.lazy(() => import('../components/Docs/users'));
/* istanbul ignore next */
import DashRoutes from '../containers/DashRoutes';
import Noredirect from '../pages/Noredirect';
import RedirectHandler from '../pages/RedirectHandler';
import ProtectedRoutes from '../ProtectedRoute';
import RemoveTokenPage from '../utils/RemoveTokenPage';
import PrivateRoute from '../utils/PrivateRoute';
import CalendarConfirmation from '../components/CalendarConfirmation';
import NotFound from '../components/NotFoundPage';
import TwoFactorPage from '../pages/LoginWith2fa';
function MainRoutes() {
return (
<div className="min-h-screen page-layout">
<Suspense>
<Routes>
{/* <Route path="/community" element={<h1>Hello my son</h1>} /> */}
<Route path="/*" element={<DashRoutes />} />
<Route
path="/"
element={
<>
<Suspense fallback={<Skeleton />}>
<Header />
<main className="page-main bg-light-bg dark:bg-dark-frame-bg">
<Outlet />
</main>
<Footer />
</Suspense>
</>
}
>
<Route
index
element={
<Suspense fallback={<Skeleton />}>
<Home />
</Suspense>
}
/>
<Route
path="/register/:token"
element={
<Suspense fallback={<Skeleton />}>
<UserRegister />
</Suspense>
}
/>
<Route path="/register-successful" element={<Message />} />
<Route
path="/signup/org"
element={
<Suspense fallback={<Skeleton />}>
<OrgRegister />
</Suspense>
}
/>
<Route
path="/signup/org/:token"
element={
<Suspense fallback={<Skeleton />}>
<RemoveTokenPage />
</Suspense>
}
/>
<Route
path="/reset-password"
element={
<Suspense fallback={<Skeleton />}>
<ResetPassword />
</Suspense>
}
/>
<Route
path="/forgot-password/:token"
element={<ForgotPassword />}
/>
<Route
path="/login/org"
element={
<ProtectedRoutes>
<Suspense fallback={<Skeleton />}>
<Orglogin />
</Suspense>
</ProtectedRoutes>
}
/>
<Route
path="/users/login"
element={
<ProtectedRoutes>
<Suspense fallback={<Skeleton />}>
<Adminlogin />
</Suspense>
</ProtectedRoutes>
}
/>
<Route path="/users/LoginWith2fa" element={<TwoFactorPage/>}/>
<Route
path="/pricing"
element={
<Suspense fallback={<Skeleton />}>
<Pricing />{' '}
</Suspense>
}
/>
<Route
path="/about"
element={
<Suspense fallback={<Skeleton />}>
<About title={'About Page'} />
</Suspense>
}
/>
<Route
path="/community"
element={
<Suspense fallback={<Skeleton />}>
<Community />
</Suspense>
}
/>
<Route
path="/product"
element={
<Suspense fallback={<Skeleton />}>
<Product title={'Productpage'} />
</Suspense>
}
/>
<Route
path="/contact-us"
element={
<Suspense fallback={<Skeleton />}>
<ContactUs />
</Suspense>
}
/>
<Route path="/docs/org-signup" element={<SignupOrgDocs />} />
<Route path="/docs/org-signin" element={<SigninOrgDocs />} />
<Route
path="/docs/getting-started"
element={
<Suspense fallback={<Skeleton />}>
<UsersDocs />
</Suspense>
}
/>
<Route path="/noredirect" element={<Noredirect />} />
<Route path="/redirect" element={<RedirectHandler />} />
<Route
path="/calendar/confirm"
element={
<PrivateRoute>
<CalendarConfirmation />
</PrivateRoute>
}
></Route>
</Route>
<Route path="*" element={<NotFound />} />
</Routes>
</Suspense>
</div>
);
}
export default MainRoutes;