Skip to content

Commit 4a142ba

Browse files
committed
feat: introduced soft route group to keep navbar and footer for specific routes
1 parent a2a13fa commit 4a142ba

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

src/app/(home)/layout.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import Footer from "@/components/Footer";
2+
import Navbar from "@/components/Navbar";
3+
4+
export default async function HomeLayout({
5+
children,
6+
}: Readonly<{
7+
children: React.ReactNode;
8+
}>) {
9+
return (
10+
<>
11+
<Navbar />
12+
<div className="flex-grow mx-auto max-w-full px-4 sm:px-12 md:px-16 lg:max-w-5xl xl:max-w-6xl 2xl:max-w-7xl">{children}</div>
13+
<Footer />
14+
</>
15+
);
16+
}
File renamed without changes.

src/app/layout.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import { Inter, Space_Mono } from 'next/font/google'
33
import { Providers } from './providers'
44
import "./globals.css";
55
import { detailsForMetadata } from "@/data/resume";
6-
import Footer from "@/components/Footer";
7-
import Navbar from "@/components/Navbar";
86
import { cn } from "@/lib/utils";
97
import { SmoothScrollProvider } from "@/components/SmoothScrollProvider";
108

@@ -66,9 +64,7 @@ export default function RootLayout({ children, }: { children: React.ReactNode; }
6664
<SmoothScrollProvider offset={90}>
6765
<div className="flex flex-col min-h-screen">
6866
<Providers>
69-
<Navbar />
70-
<div className="flex-grow mx-auto max-w-full px-4 sm:px-12 md:px-16 lg:max-w-5xl xl:max-w-6xl 2xl:max-w-7xl">{children}</div>
71-
<Footer />
67+
{children}
7268
</Providers>
7369
</div>
7470
</SmoothScrollProvider>

0 commit comments

Comments
 (0)