1- import React , { lazy } from "react" ;
1+ import React from "react" ;
22import {
33 RouteObject ,
44 RouterProvider ,
@@ -7,40 +7,51 @@ import {
77import { Web } from "@litespace/utils/routes" ;
88import * as Sentry from "@sentry/react" ;
99import Splash from "@/pages/Splash" ;
10+ import { lazyWithRetry } from "@/lib/lazy" ;
1011
11- const Root = lazy ( ( ) => import ( "@/pages/Root" ) ) ;
12- const Login = lazy ( ( ) => import ( "@/pages/Login" ) ) ;
13- const Register = lazy ( ( ) => import ( "@/pages/Register" ) ) ;
14- const Crash = lazy ( ( ) => import ( "@/pages/Crash" ) ) ;
15- const TutorProfile = lazy ( ( ) => import ( "@/pages/TutorProfile" ) ) ;
16- const CompleteProfile = lazy ( ( ) => import ( "@/pages/CompleteProfile" ) ) ;
17- const StudentDashboard = lazy ( ( ) => import ( "@/pages/StudentDashboard" ) ) ;
18- const LessonsSchedule = lazy ( ( ) => import ( "@/pages/LessonsSchedule" ) ) ;
19- const StudentSettings = lazy ( ( ) => import ( "@/pages/StudentSettings" ) ) ;
20- const Payments = lazy ( ( ) => import ( "@/pages/Payments" ) ) ;
21- const Tutors = lazy ( ( ) => import ( "@/pages/Tutors" ) ) ;
22- const Chat = lazy ( ( ) => import ( "@/pages/Chat" ) ) ;
23- const Lessons = lazy ( ( ) => import ( "@/pages/Lessons" ) ) ;
24- const Plans = lazy ( ( ) => import ( "@/pages/Plans" ) ) ;
25- const Lesson = lazy ( ( ) => import ( "@/pages/Lesson" ) ) ;
26- const TutorAccountSettings = lazy ( ( ) => import ( "@/pages/TutorAccountSettings" ) ) ;
27- const TutorProfileSettings = lazy ( ( ) => import ( "@/pages/TutorProfileSettings" ) ) ;
28- const ScheduleManagement = lazy ( ( ) => import ( "@/pages/ScheduleManagement" ) ) ;
29- const TutorDashboard = lazy ( ( ) => import ( "@/pages/TutorDashboard" ) ) ;
30- const Invoices = lazy ( ( ) => import ( "@/pages/Invoices" ) ) ;
31- const CardAdded = lazy ( ( ) => import ( "@/pages/CardAdded" ) ) ;
32- const Checkout = lazy ( ( ) => import ( "@/pages/Checkout" ) ) ;
33- const CompleteTutorProfile = lazy ( ( ) => import ( "@/pages/CompleteTutorProfile" ) ) ;
34- const TutorOnboarding = lazy ( ( ) => import ( "@/pages/TutorOnboarding" ) ) ;
35- const Interview = lazy ( ( ) => import ( "@/pages/Interview" ) ) ;
36- const DemoSession = lazy ( ( ) => import ( "@/pages/DemoSession" ) ) ;
12+ const Root = lazyWithRetry ( ( ) => import ( "@/pages/Root" ) ) ;
13+ const Login = lazyWithRetry ( ( ) => import ( "@/pages/Login" ) ) ;
14+ const Register = lazyWithRetry ( ( ) => import ( "@/pages/Register" ) ) ;
15+ const TutorProfile = lazyWithRetry ( ( ) => import ( "@/pages/TutorProfile" ) ) ;
16+ const CompleteProfile = lazyWithRetry ( ( ) => import ( "@/pages/CompleteProfile" ) ) ;
17+ const StudentDashboard = lazyWithRetry (
18+ ( ) => import ( "@/pages/StudentDashboard" )
19+ ) ;
20+ const LessonsSchedule = lazyWithRetry ( ( ) => import ( "@/pages/LessonsSchedule" ) ) ;
21+ const StudentSettings = lazyWithRetry ( ( ) => import ( "@/pages/StudentSettings" ) ) ;
22+ const Payments = lazyWithRetry ( ( ) => import ( "@/pages/Payments" ) ) ;
23+ const Tutors = lazyWithRetry ( ( ) => import ( "@/pages/Tutors" ) ) ;
24+ const Chat = lazyWithRetry ( ( ) => import ( "@/pages/Chat" ) ) ;
25+ const Lessons = lazyWithRetry ( ( ) => import ( "@/pages/Lessons" ) ) ;
26+ const Plans = lazyWithRetry ( ( ) => import ( "@/pages/Plans" ) ) ;
27+ const Lesson = lazyWithRetry ( ( ) => import ( "@/pages/Lesson" ) ) ;
28+ const TutorAccountSettings = lazyWithRetry (
29+ ( ) => import ( "@/pages/TutorAccountSettings" )
30+ ) ;
31+ const TutorProfileSettings = lazyWithRetry (
32+ ( ) => import ( "@/pages/TutorProfileSettings" )
33+ ) ;
34+ const ScheduleManagement = lazyWithRetry (
35+ ( ) => import ( "@/pages/ScheduleManagement" )
36+ ) ;
37+ const TutorDashboard = lazyWithRetry ( ( ) => import ( "@/pages/TutorDashboard" ) ) ;
38+ const Invoices = lazyWithRetry ( ( ) => import ( "@/pages/Invoices" ) ) ;
39+ const CardAdded = lazyWithRetry ( ( ) => import ( "@/pages/CardAdded" ) ) ;
40+ const Checkout = lazyWithRetry ( ( ) => import ( "@/pages/Checkout" ) ) ;
41+ const CompleteTutorProfile = lazyWithRetry (
42+ ( ) => import ( "@/pages/CompleteTutorProfile" )
43+ ) ;
44+ const TutorOnboarding = lazyWithRetry ( ( ) => import ( "@/pages/TutorOnboarding" ) ) ;
45+ const Interview = lazyWithRetry ( ( ) => import ( "@/pages/Interview" ) ) ;
46+ const DemoSession = lazyWithRetry ( ( ) => import ( "@/pages/DemoSession" ) ) ;
47+ const Crash = lazyWithRetry ( ( ) => import ( "@/pages/Crash" ) ) ;
3748
3849const createRouter = Sentry . wrapCreateBrowserRouterV6 ( createBrowserRouter ) ;
3950
4051function withCrash ( routes : RouteObject [ ] ) : RouteObject [ ] {
4152 return routes . map ( ( route ) => ( {
4253 ...route ,
43- element : < Splash children = { route . element } position = "top" /> ,
54+ element : route . element ,
4455 errorElement : < Splash children = { < Crash /> } position = "top" /> ,
4556 } ) ) ;
4657}
@@ -80,7 +91,11 @@ const router = createRouter([
8091] ) ;
8192
8293function App ( ) : React . JSX . Element {
83- return < RouterProvider router = { router } /> ;
94+ return (
95+ < Splash position = "top" >
96+ < RouterProvider router = { router } /> ;
97+ </ Splash >
98+ ) ;
8499}
85100
86101export default App ;
0 commit comments