Hide sidebar on October route

This commit is contained in:
2026-09-10 13:48:23 -04:00
parent 523f36afbd
commit 52a2177f43
2 changed files with 27 additions and 13 deletions
+2 -13
View File
@@ -3,8 +3,7 @@ import type { Metadata } from "next";
import { env } from "~/env";
import { Footer } from "~/components/Footer";
import { Navigation } from "~/components/Navigation";
import { Sidebar } from "~/components/Sidebar";
import { BreadcrumbWrapper } from "~/components/BreadcrumbWrapper";
import { SiteFrame } from "~/components/SiteFrame";
import { BreadcrumbProvider } from "~/context/BreadcrumbContext";
import { playfair } from "~/lib/fonts";
@@ -53,17 +52,7 @@ export default function RootLayout({ children }: React.PropsWithChildren) {
<BreadcrumbProvider>
<Navigation />
<div className="flex flex-1 flex-col pt-16 lg:flex-row">
<Sidebar />
<div className="min-w-0 flex-1 lg:pl-80">
<div className="mx-auto max-w-screen-xl px-4 sm:px-6 lg:pl-0 lg:pr-6">
<main className="p-4 pb-6 pt-6 sm:p-6 sm:pb-8 sm:pt-8">
<BreadcrumbWrapper />
{children}
</main>
</div>
</div>
</div>
<SiteFrame>{children}</SiteFrame>
</BreadcrumbProvider>
<Footer />
</body>
+25
View File
@@ -0,0 +1,25 @@
"use client";
import { usePathname } from "next/navigation";
import { BreadcrumbWrapper } from "~/components/BreadcrumbWrapper";
import { Sidebar } from "~/components/Sidebar";
import { cn } from "~/lib/utils";
export function SiteFrame({ children }: React.PropsWithChildren) {
const pathname = usePathname();
const showSidebar = pathname !== "/october";
return (
<div className="flex flex-1 flex-col pt-16 lg:flex-row">
{showSidebar ? <Sidebar /> : null}
<div className={cn("min-w-0 flex-1", showSidebar && "lg:pl-80")}>
<div className="mx-auto max-w-screen-xl px-4 sm:px-6 lg:pl-0 lg:pr-6">
<main className="p-4 pb-6 pt-6 sm:p-6 sm:pb-8 sm:pt-8">
<BreadcrumbWrapper />
{children}
</main>
</div>
</div>
</div>
);
}