Lock viewport height and prevent outer scroll when noPadding is set

This commit is contained in:
2026-03-11 21:49:06 -07:00
parent 303935c963
commit 17dc330b99
+5 -2
View File
@@ -38,7 +38,10 @@ export default function PageLayout({
const [open, setOpen] = useState(false);
return (
<div className="flex min-h-screen flex-col bg-gradient-to-b from-background to-background/95">
<div className={cn(
"flex flex-col bg-gradient-to-b from-background to-background/95",
noPadding ? "h-[100dvh] overflow-hidden" : "min-h-screen",
)}>
<header className="border-b border-border bg-card/80 backdrop-blur-sm">
<div className="mx-auto flex h-14 max-w-4xl items-center justify-between px-4">
<Link to="/" className="text-lg font-bold tracking-tight text-primary">
@@ -188,7 +191,7 @@ export default function PageLayout({
</div>
</div>
</header>
<main className={cn("mx-auto w-full max-w-4xl flex-1", noPadding ? "" : "px-4 py-6")} role="main">
<main className={cn("mx-auto w-full max-w-4xl flex-1", noPadding ? "overflow-hidden" : "px-4 py-6")} role="main">
{children}
</main>
</div>