1- import { Router , useCurrentMatches } from "@solidjs/router" ;
2- import { FileRoutes } from "@solidjs/start/router" ;
1+ import { Route , Router , useCurrentMatches } from "@solidjs/router" ;
32import { QueryClient , QueryClientProvider } from "@tanstack/solid-query" ;
43import {
54 getCurrentWebviewWindow ,
65 type WebviewWindow ,
76} from "@tauri-apps/api/webviewWindow" ;
87import { message } from "@tauri-apps/plugin-dialog" ;
9- import { createEffect , onCleanup , onMount , Suspense } from "solid-js" ;
8+ import { createEffect , lazy , onCleanup , onMount , Suspense } from "solid-js" ;
109import { Toaster } from "solid-toast" ;
1110
1211import "@cap/ui-solid/main.css" ;
@@ -19,6 +18,61 @@ import { initAnonymousUser } from "./utils/analytics";
1918import { type AppTheme , commands } from "./utils/tauri" ;
2019import titlebar from "./utils/titlebar-state" ;
2120
21+ const WindowChromeLayout = lazy ( ( ) => import ( "./routes/(window-chrome)" ) ) ;
22+ const MainPage = lazy ( ( ) => import ( "./routes/(window-chrome)/(main)" ) ) ;
23+ const NewMainPage = lazy ( ( ) => import ( "./routes/(window-chrome)/new-main" ) ) ;
24+ const SetupPage = lazy ( ( ) => import ( "./routes/(window-chrome)/setup" ) ) ;
25+ const SettingsLayout = lazy ( ( ) => import ( "./routes/(window-chrome)/settings" ) ) ;
26+ const SettingsGeneralPage = lazy (
27+ ( ) => import ( "./routes/(window-chrome)/settings/general" ) ,
28+ ) ;
29+ const SettingsRecordingsPage = lazy (
30+ ( ) => import ( "./routes/(window-chrome)/settings/recordings" ) ,
31+ ) ;
32+ const SettingsScreenshotsPage = lazy (
33+ ( ) => import ( "./routes/(window-chrome)/settings/screenshots" ) ,
34+ ) ;
35+ const SettingsHotkeysPage = lazy (
36+ ( ) => import ( "./routes/(window-chrome)/settings/hotkeys" ) ,
37+ ) ;
38+ const SettingsChangelogPage = lazy (
39+ ( ) => import ( "./routes/(window-chrome)/settings/changelog" ) ,
40+ ) ;
41+ const SettingsFeedbackPage = lazy (
42+ ( ) => import ( "./routes/(window-chrome)/settings/feedback" ) ,
43+ ) ;
44+ const SettingsExperimentalPage = lazy (
45+ ( ) => import ( "./routes/(window-chrome)/settings/experimental" ) ,
46+ ) ;
47+ const SettingsLicensePage = lazy (
48+ ( ) => import ( "./routes/(window-chrome)/settings/license" ) ,
49+ ) ;
50+ const SettingsIntegrationsPage = lazy (
51+ ( ) => import ( "./routes/(window-chrome)/settings/integrations" ) ,
52+ ) ;
53+ const SettingsS3ConfigPage = lazy (
54+ ( ) => import ( "./routes/(window-chrome)/settings/integrations/s3-config" ) ,
55+ ) ;
56+ const UpgradePage = lazy ( ( ) => import ( "./routes/(window-chrome)/upgrade" ) ) ;
57+ const UpdatePage = lazy ( ( ) => import ( "./routes/(window-chrome)/update" ) ) ;
58+ const CameraPage = lazy ( ( ) => import ( "./routes/camera" ) ) ;
59+ const CaptureAreaPage = lazy ( ( ) => import ( "./routes/capture-area" ) ) ;
60+ const DebugPage = lazy ( ( ) => import ( "./routes/debug" ) ) ;
61+ const EditorPage = lazy ( ( ) => import ( "./routes/editor" ) ) ;
62+ const InProgressRecordingPage = lazy (
63+ ( ) => import ( "./routes/in-progress-recording" ) ,
64+ ) ;
65+ const ModeSelectPage = lazy ( ( ) => import ( "./routes/mode-select" ) ) ;
66+ const NotificationsPage = lazy ( ( ) => import ( "./routes/notifications" ) ) ;
67+ const RecordingsOverlayPage = lazy ( ( ) => import ( "./routes/recordings-overlay" ) ) ;
68+ const ScreenshotEditorPage = lazy ( ( ) => import ( "./routes/screenshot-editor" ) ) ;
69+ const TargetSelectOverlayPage = lazy (
70+ ( ) => import ( "./routes/target-select-overlay" ) ,
71+ ) ;
72+ const WindowCaptureOccluderPage = lazy (
73+ ( ) => import ( "./routes/window-capture-occluder" ) ,
74+ ) ;
75+
2276const queryClient = new QueryClient ( {
2377 defaultOptions : {
2478 queries : {
@@ -97,7 +151,55 @@ function Inner() {
97151 ) ;
98152 } }
99153 >
100- < FileRoutes />
154+ < Route path = "/" component = { WindowChromeLayout } >
155+ < Route path = "/" component = { MainPage } />
156+ < Route path = "/new-main" component = { NewMainPage } />
157+ < Route path = "/setup" component = { SetupPage } />
158+ < Route path = "/settings" component = { SettingsLayout } >
159+ < Route path = "/" component = { SettingsGeneralPage } />
160+ < Route path = "/general" component = { SettingsGeneralPage } />
161+ < Route path = "/recordings" component = { SettingsRecordingsPage } />
162+ < Route path = "/screenshots" component = { SettingsScreenshotsPage } />
163+ < Route path = "/hotkeys" component = { SettingsHotkeysPage } />
164+ < Route path = "/changelog" component = { SettingsChangelogPage } />
165+ < Route path = "/feedback" component = { SettingsFeedbackPage } />
166+ < Route
167+ path = "/experimental"
168+ component = { SettingsExperimentalPage }
169+ />
170+ < Route path = "/license" component = { SettingsLicensePage } />
171+ < Route
172+ path = "/integrations"
173+ component = { SettingsIntegrationsPage }
174+ />
175+ < Route
176+ path = "/integrations/s3-config"
177+ component = { SettingsS3ConfigPage }
178+ />
179+ </ Route >
180+ < Route path = "/upgrade" component = { UpgradePage } />
181+ < Route path = "/update" component = { UpdatePage } />
182+ </ Route >
183+ < Route path = "/camera" component = { CameraPage } />
184+ < Route path = "/capture-area" component = { CaptureAreaPage } />
185+ < Route path = "/debug" component = { DebugPage } />
186+ < Route path = "/editor" component = { EditorPage } />
187+ < Route
188+ path = "/in-progress-recording"
189+ component = { InProgressRecordingPage }
190+ />
191+ < Route path = "/mode-select" component = { ModeSelectPage } />
192+ < Route path = "/notifications" component = { NotificationsPage } />
193+ < Route path = "/recordings-overlay" component = { RecordingsOverlayPage } />
194+ < Route path = "/screenshot-editor" component = { ScreenshotEditorPage } />
195+ < Route
196+ path = "/target-select-overlay"
197+ component = { TargetSelectOverlayPage }
198+ />
199+ < Route
200+ path = "/window-capture-occluder"
201+ component = { WindowCaptureOccluderPage }
202+ />
101203 </ Router >
102204 </ CapErrorBoundary >
103205 </ >
0 commit comments