Skip to content

Commit 8283808

Browse files
committed
refactor(layout): wrap ProtectedRoute with Suspense
1 parent f40e6d1 commit 8283808

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

app/(app)/layout.tsx

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,23 @@ import AppShell from "@/components/app-shell";
22
import DynamicPostHogIdentifier from "@/providers/posthog-identifier.dynamic";
33
import AuthorizedApolloWrapper from "@/providers/use-apollo.rsc";
44
import ProtectedRoute from "@/providers/use-protected-route";
5-
import { unstable_ViewTransition as ViewTransition } from "react";
5+
import { Suspense, ViewTransition } from "react";
66

77
export default function Layout({ children }: { children: React.ReactNode }) {
88
return (
9-
<ProtectedRoute>
10-
<AuthorizedApolloWrapper>
11-
<AppShell>
12-
<div className="mx-auto w-full max-w-7xl flex-1 p-3">
13-
<ViewTransition name="app-content">
14-
<div suppressHydrationWarning>{children}</div>
15-
</ViewTransition>
16-
</div>
17-
</AppShell>
18-
<DynamicPostHogIdentifier />
19-
</AuthorizedApolloWrapper>
20-
</ProtectedRoute>
9+
<Suspense>
10+
<ProtectedRoute>
11+
<AuthorizedApolloWrapper>
12+
<AppShell>
13+
<div className="mx-auto w-full max-w-7xl flex-1 p-3">
14+
<ViewTransition name="app-content">
15+
<div suppressHydrationWarning>{children}</div>
16+
</ViewTransition>
17+
</div>
18+
</AppShell>
19+
<DynamicPostHogIdentifier />
20+
</AuthorizedApolloWrapper>
21+
</ProtectedRoute>
22+
</Suspense>
2123
);
2224
}

0 commit comments

Comments
 (0)