Skip to content

Commit 4a6b731

Browse files
committed
refactor: move navbar & footer to layout.tsx
1 parent b2099e9 commit 4a6b731

File tree

4 files changed

+20
-54
lines changed

4 files changed

+20
-54
lines changed

site/src/app/layout.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { Inter, Space_Mono } from 'next/font/google'
33
import { Providers } from './providers'
44
import "./globals.css";
55
import { detailsForMetadata } from "./config";
6+
import Footer from "@/components/Footer";
7+
import Navbar from "@/components/Navbar";
68

79
const inter = Inter({ subsets: ['latin'] })
810
const spaceMono = Space_Mono({
@@ -58,7 +60,11 @@ export default function RootLayout({
5860
<html lang="en" className={`${inter.className} ${spaceMono.variable}`} suppressHydrationWarning>
5961
<body suppressHydrationWarning>
6062
<div className={`min-h-screen bg-neutral-100 dark:bg-neutral-950 text-gray-800 dark:text-gray-200`}>
63+
<div className="transition-colors duration-300">
64+
<Navbar />
6165
<Providers> {children} </Providers>
66+
<Footer />
67+
</div>
6268
</div>
6369
</body>
6470
</html>

site/src/app/page.tsx

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,24 @@
11
"use client";
22

33
import Header from '@/components/Header'
4-
import Footer from '@/components/Footer'
54
import About from '@/components/About'
65
import { Experiences } from '@/components/Experiences'
76
import { Projects } from '@/components/Projects'
87
import { Education } from '@/components/Education'
98
import { Skills } from '@/components/Skills';
10-
import Navbar from '@/components/Navbar';
119
import { personalDetails, experiencesArray, projectsArray, skillsArray } from '@/app/config';
12-
import SmoothScroll from '@/hooks/smoothScrollEffect';
1310

1411
export default function Portfolio() {
1512
return (
16-
<div className="transition-colors duration-300">
17-
<SmoothScroll />
18-
<Navbar />
19-
<div className="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">
20-
<Header {...personalDetails} />
21-
<main className="container mx-auto py-8 z-1">
22-
<About />
23-
<Experiences arr={experiencesArray} />
24-
<Education />
25-
<Skills arr={skillsArray}/>
26-
<Projects arr={projectsArray} />
27-
</main>
28-
<Footer />
29-
</div>
13+
<div className="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">
14+
<Header {...personalDetails} />
15+
<main className="container mx-auto py-8 z-1">
16+
<About />
17+
<Experiences arr={experiencesArray} />
18+
<Education />
19+
<Skills arr={skillsArray}/>
20+
<Projects arr={projectsArray} />
21+
</main>
3022
</div>
3123
)
3224
}

site/src/components/Footer.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
import { ArrowUpRight } from "lucide-react"
22
import { detailsForMetadata, personalDetails } from "@/app/config"
3+
import { cn } from "@/lib/utils"
34

45
const Footer = () => {
56
return (
6-
<footer className="py-16 text-gray-500 dark:text-gray-400 flex flex-col items-center justify-center sm:flex-row-reverse sm:justify-between">
7+
<footer className={cn(
8+
"py-16 text-gray-500 dark:text-gray-400 flex flex-col items-center justify-center sm:flex-row-reverse sm:justify-between",
9+
"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"
10+
)}>
711
<div className="flex justify-center md:justify-start space-x-4">
812
<a href={personalDetails.githubLink} target="_blank" rel="noopener noreferrer" aria-label="GitHub"
913
className="inline-flex items-center hover:underline hover:underline-offset-2 text-pink-500"

site/src/hooks/smoothScrollEffect.tsx

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)