mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-08-29 03:55:38 -04:00
overflow-x-hidden on the pages wrapper div created a new scroll context that prevented position: sticky from working on the header. Moving it to <body> preserves the horizontal overflow clipping without breaking sticky positioning. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
31 lines
970 B
TypeScript
31 lines
970 B
TypeScript
import { headers } from "next/headers";
|
|
import { redirect } from "next/navigation";
|
|
import { CommandPalette } from "@/components/command-palette";
|
|
import { MobileTabBar } from "@/components/mobile-tab-bar";
|
|
import { NavBar } from "@/components/nav-bar";
|
|
import { auth } from "@/lib/auth/server";
|
|
|
|
export default async function PagesLayout({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode;
|
|
}) {
|
|
const session = await auth.api.getSession({ headers: await headers() });
|
|
if (!session) redirect("/login");
|
|
|
|
return (
|
|
<>
|
|
<div className="min-h-screen pb-14 sm:pb-0">
|
|
<NavBar />
|
|
{/* Ambient glow */}
|
|
<div className="pointer-events-none fixed left-1/2 top-1/4 -translate-x-1/2 -translate-y-1/2 h-[600px] w-[800px] rounded-full bg-primary/3 blur-[200px]" />
|
|
<main className="relative mx-auto max-w-6xl px-4 py-6 sm:px-6">
|
|
{children}
|
|
</main>
|
|
</div>
|
|
<MobileTabBar />
|
|
<CommandPalette />
|
|
</>
|
|
);
|
|
}
|