Fix missing suspenses in routing

Signed-off-by: Émile Ré <nemile.re@gmail.com>
This commit is contained in:
Émile Ré
2025-03-14 11:39:24 +04:00
parent 9d174bb462
commit ac7fa6edb3
2 changed files with 240 additions and 244 deletions

View File

@@ -63,48 +63,9 @@ function App() {
<HelmetProvider>
<BrowserRouter>
<Routes>
{/* Authentication Routes - Accessible without login */}
<Route path="/*">
<Route
element={
<ErrorBoundaryWithLocation>
<AuthLayout />
</ErrorBoundaryWithLocation>
}
>
<Route
path="login"
element={
<Suspense>
<ErrorBoundaryWithLocation>
<LoginPage />
</ErrorBoundaryWithLocation>
</Suspense>
}
/>
<Route
path="register"
element={
<Suspense>
<ErrorBoundaryWithLocation>
<RegisterPage />
</ErrorBoundaryWithLocation>
</Suspense>
}
/>
<Route
path="confirm-email"
element={
<Suspense>
<ErrorBoundaryWithLocation>
<ConfirmEmailPage />
</ErrorBoundaryWithLocation>
</Suspense>
}
/>
</Route>
<Route
path="/"
index
element={
<Suspense>
<ErrorBoundaryWithLocation>
@@ -114,15 +75,7 @@ function App() {
}
/>
<Route
element={
<Suspense>
<ErrorBoundaryWithLocation>
<ConsoleLayout />
</ErrorBoundaryWithLocation>
</Suspense>
}
>
<Route path="*" element={<ConsoleLayout />}>
<Route path="organizations">
<Route
path="create"
@@ -320,14 +273,54 @@ function App() {
</Route>
</Route>
{/* Authentication Routes - Accessible without login */}
<Route
element={
<ErrorBoundaryWithLocation>
<AuthLayout />
</ErrorBoundaryWithLocation>
}
>
<Route
path="login"
element={
<Suspense>
<ErrorBoundaryWithLocation>
<LoginPage />
</ErrorBoundaryWithLocation>
</Suspense>
}
/>
<Route
path="register"
element={
<Suspense>
<ErrorBoundaryWithLocation>
<RegisterPage />
</ErrorBoundaryWithLocation>
</Suspense>
}
/>
<Route
path="confirm-email"
element={
<Suspense>
<ErrorBoundaryWithLocation>
<ConfirmEmailPage />
</ErrorBoundaryWithLocation>
</Suspense>
}
/>
</Route>
<Route
path="*"
element={
<Suspense>
<NotFoundPage />
</Suspense>
}
/>
</Route>
</Routes>
</BrowserRouter>
</HelmetProvider>

View File

@@ -368,7 +368,9 @@ function BreadcrumbUpdatePolicy() {
export default function ConsoleLayout() {
return (
<SidebarProvider>
<Suspense>
<AppSidebar />
</Suspense>
<SidebarInset>
<header className="flex h-16 shrink-0 items-center gap-2">
<div className="flex items-center gap-2 px-4">
@@ -467,6 +469,7 @@ export default function ConsoleLayout() {
}
/>
</Route>
<Route path="*" element={<BreadcrumbHome />}>
<Route
path="create"