Files
community-rule/app/(app)/layout.tsx
T
2026-05-26 07:24:36 -06:00

26 lines
1.1 KiB
TypeScript

import type { ReactNode } from "react";
import ConditionalNavigation from "../components/navigation/ConditionalNavigation";
import { MessagesProvider } from "../contexts/MessagesContext";
import { AuthModalProvider } from "../contexts/AuthModalContext";
import messages from "../../messages/en/index";
// Reads `cr_session` via Server Components on every navigation so the header
// matches the HttpOnly cookie on the first HTML response (no "Log in" flash
// before `/api/auth/session`). Scoped here instead of the root layout so
// `(marketing)` can render statically.
export const dynamic = "force-dynamic";
// Signed-in product surfaces (`/create/*`, `/login`) run without the marketing
// footer. `/profile` adds it via `profile/layout.tsx`. Per-route chrome (e.g.
// CreateFlow) is composed in nested layouts.
export default function AppLayout({ children }: { children: ReactNode }) {
return (
<MessagesProvider messages={messages}>
<AuthModalProvider>
<ConditionalNavigation />
<main className="flex-1">{children}</main>
</AuthModalProvider>
</MessagesProvider>
);
}