3452 |
stevensc |
1 |
import React, { lazy, Suspense } from 'react';
|
3481 |
stevensc |
2 |
import { Routes, Route, Navigate } from 'react-router-dom';
|
2611 |
stevensc |
3 |
|
2632 |
stevensc |
4 |
/* Components */
|
3452 |
stevensc |
5 |
import AuthRoute from './auth-routes';
|
|
|
6 |
import PrivateRoutes from './private-routes';
|
|
|
7 |
import Spinner from '@components/UI/Spinner';
|
2611 |
stevensc |
8 |
|
2626 |
stevensc |
9 |
/* Layouts */
|
3452 |
stevensc |
10 |
import RootLayout from '@layouts/root';
|
|
|
11 |
import AppsNavigation from '@pages/apps-navigation/AppsNavigation';
|
3127 |
stevensc |
12 |
|
3452 |
stevensc |
13 |
import HabitsRoutes from './habits/routes';
|
|
|
14 |
import GroupRoutes from './groups/routes';
|
|
|
15 |
import PrivateRoutesLayout from '@layouts/private-routes';
|
3577 |
stevensc |
16 |
import KnowledgesRoutes from '@knowledges/routes/KnowledgesRoutes';
|
3194 |
stevensc |
17 |
|
3563 |
stevensc |
18 |
/* Modules */
|
3649 |
stevensc |
19 |
const MicrolearningRoutes = lazy(() => import('@microlearning/routes'));
|
3565 |
stevensc |
20 |
const MarketplaceRoutes = lazy(() => import('@marketplace/routes/MarketplaceRoutes'));
|
3577 |
stevensc |
21 |
const InmailRoutes = lazy(() => import('@inmail/routes/InmailRoutes'));
|
3563 |
stevensc |
22 |
|
|
|
23 |
/* Layouts */
|
3452 |
stevensc |
24 |
const AuthLayout = lazy(() => import('@layouts/auth-layout'));
|
3190 |
stevensc |
25 |
|
2626 |
stevensc |
26 |
/* Pages */
|
3452 |
stevensc |
27 |
const Browsers = lazy(() => import('@pages/account-settings/browsers'));
|
|
|
28 |
const BasicSettings = lazy(() => import('@pages/account-settings/basic-settings'));
|
|
|
29 |
const ChangeImage = lazy(() => import('@pages/account-settings/change-image'));
|
|
|
30 |
const ChangePassword = lazy(() => import('@pages/account-settings/change-password'));
|
|
|
31 |
const Devices = lazy(() => import('@pages/account-settings/devices'));
|
|
|
32 |
const Ips = lazy(() => import('@pages/account-settings/ips'));
|
|
|
33 |
const Location = lazy(() => import('@pages/account-settings/location'));
|
|
|
34 |
const Notifications = lazy(() => import('@pages/account-settings/notifications'));
|
|
|
35 |
const Privacy = lazy(() => import('@pages/account-settings/privacy'));
|
|
|
36 |
const Transactions = lazy(() => import('@pages/account-settings/transactions'));
|
|
|
37 |
const CloseAccount = lazy(() => import('@pages/account-settings/close-account'));
|
|
|
38 |
const Login = lazy(() => import('@app/pages/auth/login'));
|
|
|
39 |
const Signup = lazy(() => import('@app/pages/auth/signup'));
|
2630 |
stevensc |
40 |
// const Navigation = lazy(() => import('@pages/auth/navigation'))
|
3452 |
stevensc |
41 |
const ForgotPassword = lazy(() => import('@pages/auth/forgot-password'));
|
|
|
42 |
const ActiveAccount = lazy(() => import('@pages/auth/active-account'));
|
|
|
43 |
const ResetPassword = lazy(() => import('@pages/auth/reset-password'));
|
|
|
44 |
const AbuseReportPage = lazy(() => import('@pages/abuse-report/abuse-repor-page'));
|
|
|
45 |
const AbuseReportViewPage = lazy(() => import('@pages/abuse-report/abuse-report-view-page'));
|
|
|
46 |
const ShorterPostPage = lazy(() => import('@pages/shorter/shorter-post-page'));
|
|
|
47 |
const TermsAndConditionsPage = lazy(
|
|
|
48 |
() => import('@pages/terms-and-conditions/TermsAndConditionsPage')
|
|
|
49 |
);
|
|
|
50 |
const PrivacyPolicyPage = lazy(() => import('@pages/privacy-policy/PrivacyPolicy'));
|
|
|
51 |
const CookiesPage = lazy(() => import('@pages/cookies/CookiesPage'));
|
|
|
52 |
const ProfessionalismPolicy = lazy(
|
|
|
53 |
() => import('@pages/professionalism-policy/ProfessionalismPolicy')
|
|
|
54 |
);
|
|
|
55 |
const AccountSettingsLayout = lazy(() => import('@layouts/account-settings'));
|
|
|
56 |
const DashboardPage = lazy(() => import('@pages/dashboard/dashboard-page'));
|
|
|
57 |
const MyConnectionsPage = lazy(() => import('@pages/connections/MyConnectionsPage'));
|
|
|
58 |
const InvitationsReceivedPage = lazy(() => import('@pages/connections/InvitationsReceivedPage'));
|
|
|
59 |
const InvitationsSendPage = lazy(() => import('@pages/connections/InvitationsSendPage'));
|
|
|
60 |
const PeopleYouMayKnowPage = lazy(() => import('@pages/connections/PeopleYouMayKnowPage'));
|
|
|
61 |
const PeopleBlockedPage = lazy(() => import('@pages/connections/PeopleBlockedPage'));
|
|
|
62 |
const MyProfilesPage = lazy(() => import('@pages/profiles/MyProfilesPage'));
|
|
|
63 |
const PeopleViewedMyProfilePage = lazy(() => import('@pages/profiles/PeopleViewedMyProfilePage'));
|
|
|
64 |
const SavedJobsPage = lazy(() => import('@pages/jobs/SavedJobsPage'));
|
|
|
65 |
const AppliedJobsPage = lazy(() => import('@pages/jobs/AppliedJobsPage'));
|
|
|
66 |
const MyCompanies = lazy(() => import('@pages/company/MyCompaniesPage'));
|
|
|
67 |
const FollowingCompaniesPage = lazy(() => import('@pages/company/CompaniesIFollowPage'));
|
|
|
68 |
const CompaniesWhenIWorkPage = lazy(() => import('@pages/company/CompaniesWhenIWorkPage'));
|
|
|
69 |
const CompanyRequestSendPage = lazy(() => import('@pages/company/CompanyRequestSendPage'));
|
|
|
70 |
const CompanyInvitationsReceivedPage = lazy(
|
|
|
71 |
() => import('@pages/company/CompanyInvitationsReceivedPage')
|
|
|
72 |
);
|
|
|
73 |
const ProfileViewPage = lazy(() => import('@pages/profiles/ProfileViewPage'));
|
|
|
74 |
const ProfileEditPage = lazy(() => import('@pages/profiles/ProfileEditPage'));
|
|
|
75 |
const CompanyViewPage = lazy(() => import('@pages/company/CompanyViewPage'));
|
|
|
76 |
const NotificationsPage = lazy(() => import('@pages/notifications/NotificationsPage'));
|
|
|
77 |
const SearchPage = lazy(() => import('@pages/search/SearchPage'));
|
2611 |
stevensc |
78 |
|
3452 |
stevensc |
79 |
const PostViewPage = lazy(() => import('@pages/posts/PostViewPage'));
|
|
|
80 |
const MyCoachPage = lazy(() => import('@pages/my-coach/MyCoachPage'));
|
|
|
81 |
const MyCoachViewPage = lazy(() => import('@pages/my-coach/MyCoachViewPage'));
|
|
|
82 |
const JobViewPage = lazy(() => import('@pages/jobs/JobView'));
|
|
|
83 |
const CalendarPage = lazy(() => import('@pages/calendar/CalendarPage'));
|
|
|
84 |
const ImpersonatePage = lazy(() => import('@pages/impersonate/InpersonatePage'));
|
|
|
85 |
|
2611 |
stevensc |
86 |
export default function AppRoutes() {
|
|
|
87 |
return (
|
2617 |
stevensc |
88 |
<Suspense fallback={<Spinner />}>
|
|
|
89 |
<Routes>
|
2803 |
stevensc |
90 |
<Route element={<RootLayout />}>
|
|
|
91 |
{/* Public routes */}
|
|
|
92 |
<Route path='/shorter/:id' element={<ShorterPostPage />} />
|
3200 |
stevensc |
93 |
|
3452 |
stevensc |
94 |
<Route path='/terms-and-conditions' element={<TermsAndConditionsPage />} />
|
3200 |
stevensc |
95 |
|
2803 |
stevensc |
96 |
<Route path='/privacy-policy' element={<PrivacyPolicyPage />} />
|
3200 |
stevensc |
97 |
|
3452 |
stevensc |
98 |
<Route path='/professionalism-policy' element={<ProfessionalismPolicy />} />
|
3200 |
stevensc |
99 |
|
2803 |
stevensc |
100 |
<Route path='/cookies' element={<CookiesPage />} />
|
2617 |
stevensc |
101 |
|
2803 |
stevensc |
102 |
{/* Authentication routes */}
|
|
|
103 |
<Route path='/' element={<AuthRoute />}>
|
|
|
104 |
<Route element={<AuthLayout />}>
|
|
|
105 |
<Route index element={<Navigate to='signin' />} />
|
|
|
106 |
<Route path='signin' element={<Login />} />
|
|
|
107 |
<Route path='signup' element={<Signup />} />
|
|
|
108 |
<Route path='forgot-password' element={<ForgotPassword />} />
|
|
|
109 |
<Route path='reset-password/:uuid' element={<ResetPassword />} />
|
3452 |
stevensc |
110 |
<Route path='activate-account/:uuid' element={<ActiveAccount />} />
|
2803 |
stevensc |
111 |
</Route>
|
2620 |
stevensc |
112 |
</Route>
|
2617 |
stevensc |
113 |
|
2803 |
stevensc |
114 |
{/* Private routes */}
|
|
|
115 |
<Route element={<PrivateRoutes />}>
|
3201 |
stevensc |
116 |
<Route element={<PrivateRoutesLayout />}>
|
3364 |
stevensc |
117 |
<Route path='/habits/*' element={<HabitsRoutes />} />
|
|
|
118 |
|
3201 |
stevensc |
119 |
<Route path='/group/*' element={<GroupRoutes />} />
|
3196 |
stevensc |
120 |
|
3201 |
stevensc |
121 |
<Route path='abuse-report'>
|
|
|
122 |
<Route index element={<AbuseReportPage />} />
|
|
|
123 |
<Route path='view/:id' element={<AbuseReportViewPage />} />
|
|
|
124 |
</Route>
|
2630 |
stevensc |
125 |
|
3201 |
stevensc |
126 |
<Route path='/dashboard'>
|
|
|
127 |
<Route index element={<DashboardPage />} />
|
|
|
128 |
<Route path='feed/:id' element={<DashboardPage />} />
|
|
|
129 |
</Route>
|
2630 |
stevensc |
130 |
|
3201 |
stevensc |
131 |
<Route path='/connection'>
|
|
|
132 |
<Route index element={<Navigate to='my-connections' />} />
|
|
|
133 |
<Route path='my-connections' element={<MyConnectionsPage />} />
|
3452 |
stevensc |
134 |
<Route path='invitations-sent' element={<InvitationsSendPage />} />
|
|
|
135 |
<Route path='invitations-received' element={<InvitationsReceivedPage />} />
|
|
|
136 |
<Route path='people-you-may-know' element={<PeopleYouMayKnowPage />} />
|
3201 |
stevensc |
137 |
<Route path='people-blocked' element={<PeopleBlockedPage />} />
|
|
|
138 |
</Route>
|
2630 |
stevensc |
139 |
|
3201 |
stevensc |
140 |
<Route path='/profile'>
|
|
|
141 |
<Route index element={<Navigate to='my-profiles' />} />
|
|
|
142 |
<Route path='view/:uuid' element={<ProfileViewPage />} />
|
3452 |
stevensc |
143 |
<Route path='people-viewed-profile' element={<PeopleViewedMyProfilePage />} />
|
3201 |
stevensc |
144 |
<Route path='my-profiles'>
|
|
|
145 |
<Route index element={<MyProfilesPage />} />
|
|
|
146 |
<Route path='edit/:uuid' element={<ProfileEditPage />} />
|
|
|
147 |
</Route>
|
2803 |
stevensc |
148 |
</Route>
|
2630 |
stevensc |
149 |
|
3201 |
stevensc |
150 |
<Route path='/job'>
|
|
|
151 |
<Route index element={<Navigate to='saved-jobs' />} />
|
|
|
152 |
<Route path='view/:uuid' element={<JobViewPage />} />
|
|
|
153 |
<Route path='saved-jobs' element={<SavedJobsPage />} />
|
|
|
154 |
<Route path='applied-jobs' element={<AppliedJobsPage />} />\
|
|
|
155 |
</Route>
|
2630 |
stevensc |
156 |
|
3201 |
stevensc |
157 |
<Route path='/company'>
|
|
|
158 |
<Route index element={<Navigate to='my-companies' />} />
|
|
|
159 |
<Route path='my-companies' element={<MyCompanies />} />
|
3452 |
stevensc |
160 |
<Route path='following-companies' element={<FollowingCompaniesPage />} />
|
|
|
161 |
<Route path='i-work-with' element={<CompaniesWhenIWorkPage />} />
|
|
|
162 |
<Route path='requests-sent' element={<CompanyRequestSendPage />} />
|
|
|
163 |
<Route path='requests-sent' element={<CompanyRequestSendPage />} />
|
|
|
164 |
<Route path='invitations-received' element={<CompanyInvitationsReceivedPage />} />
|
3201 |
stevensc |
165 |
<Route path='view/:uuid' element={<CompanyViewPage />} />
|
|
|
166 |
</Route>
|
2630 |
stevensc |
167 |
|
3563 |
stevensc |
168 |
<Route path='/marketplace/*' element={<MarketplaceRoutes />} />
|
3562 |
stevensc |
169 |
|
3201 |
stevensc |
170 |
<Route path='/my-coach'>
|
|
|
171 |
<Route index element={<MyCoachPage />} />
|
3452 |
stevensc |
172 |
<Route path='questions/view/:uuid' element={<MyCoachViewPage />} />
|
3201 |
stevensc |
173 |
</Route>
|
|
|
174 |
|
3464 |
stevensc |
175 |
<Route path='/knowledge-area/*' element={<KnowledgesRoutes />} />
|
3482 |
stevensc |
176 |
<Route path='/microlearning/*' element={<MicrolearningRoutes />} />
|
3453 |
stevensc |
177 |
|
3577 |
stevensc |
178 |
<Route path='/inmail/*' element={<InmailRoutes />} />
|
3047 |
stevensc |
179 |
|
3452 |
stevensc |
180 |
<Route path='/account-settings' element={<AccountSettingsLayout />}>
|
3201 |
stevensc |
181 |
<Route index element={<BasicSettings />} />
|
|
|
182 |
<Route path='notifications' element={<Notifications />} />
|
|
|
183 |
<Route path='change-password' element={<ChangePassword />} />
|
|
|
184 |
<Route path='change-image' element={<ChangeImage />} />
|
|
|
185 |
<Route path='location' element={<Location />} />
|
|
|
186 |
<Route path='privacy' element={<Privacy />} />
|
|
|
187 |
<Route path='browsers' element={<Browsers />} />
|
|
|
188 |
<Route path='ips' element={<Ips />} />
|
|
|
189 |
<Route path='devices' element={<Devices />} />
|
|
|
190 |
<Route path='close-account' element={<CloseAccount />} />
|
|
|
191 |
<Route path='transactions' element={<Transactions />} />
|
2803 |
stevensc |
192 |
</Route>
|
3201 |
stevensc |
193 |
<Route path='/notifications' element={<NotificationsPage />} />
|
|
|
194 |
<Route path='/search/entity/:category' element={<SearchPage />} />
|
|
|
195 |
<Route path='/calendar' element={<CalendarPage />} />
|
|
|
196 |
<Route path='/signin/impersonate' element={<ImpersonatePage />} />
|
|
|
197 |
<Route path='/post/:uuid' element={<PostViewPage />} />
|
|
|
198 |
<Route path='/apps-navigation' element={<AppsNavigation />} />
|
2803 |
stevensc |
199 |
|
3201 |
stevensc |
200 |
<Route path='*' element={<Navigate to='/dashboard' />} />
|
2632 |
stevensc |
201 |
</Route>
|
2698 |
stevensc |
202 |
</Route>
|
2617 |
stevensc |
203 |
</Route>
|
|
|
204 |
</Routes>
|
|
|
205 |
</Suspense>
|
3452 |
stevensc |
206 |
);
|
2611 |
stevensc |
207 |
}
|