Hide sidebar on October route
This commit is contained in:
+2
-13
@@ -3,8 +3,7 @@ import type { Metadata } from "next";
|
|||||||
import { env } from "~/env";
|
import { env } from "~/env";
|
||||||
import { Footer } from "~/components/Footer";
|
import { Footer } from "~/components/Footer";
|
||||||
import { Navigation } from "~/components/Navigation";
|
import { Navigation } from "~/components/Navigation";
|
||||||
import { Sidebar } from "~/components/Sidebar";
|
import { SiteFrame } from "~/components/SiteFrame";
|
||||||
import { BreadcrumbWrapper } from "~/components/BreadcrumbWrapper";
|
|
||||||
import { BreadcrumbProvider } from "~/context/BreadcrumbContext";
|
import { BreadcrumbProvider } from "~/context/BreadcrumbContext";
|
||||||
|
|
||||||
import { playfair } from "~/lib/fonts";
|
import { playfair } from "~/lib/fonts";
|
||||||
@@ -53,17 +52,7 @@ export default function RootLayout({ children }: React.PropsWithChildren) {
|
|||||||
|
|
||||||
<BreadcrumbProvider>
|
<BreadcrumbProvider>
|
||||||
<Navigation />
|
<Navigation />
|
||||||
<div className="flex flex-1 flex-col pt-16 lg:flex-row">
|
<SiteFrame>{children}</SiteFrame>
|
||||||
<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>
|
|
||||||
</BreadcrumbProvider>
|
</BreadcrumbProvider>
|
||||||
<Footer />
|
<Footer />
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user