Skip to content

Commit

Permalink
refactor: rename navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
aabuhijleh committed Nov 18, 2024
1 parent cf86fee commit c4566b1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
5 changes: 3 additions & 2 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import { Contact } from "~/components/contact";
import { Work } from "~/components/work";
import { Projects } from "~/components/projects";
import { Footer } from "~/components/footer";
import { Header } from "~/components/header";
import { Navbar } from "~/components/navbar";

export default function Home() {
return (
<main className="mx-auto max-w-screen-xl px-8">
<Header />
<Navbar />
<Hero />
<About />
<Work />
Expand Down
10 changes: 5 additions & 5 deletions assets/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,28 +39,28 @@ export const socialLinks: BrandLink[] = [

export const navLinks: NavLink[] = [
{
href: "#home",
label: "Home",
href: "#home",
icon: Home,
},
{
href: "#about",
label: "About",
href: "#about",
icon: User,
},
{
href: "#work",
label: "Work",
href: "#work",
icon: Briefcase,
},
{
href: "#projects",
label: "Projects",
href: "#projects",
icon: FolderGit,
},
{
href: "#contact",
label: "Contact",
href: "#contact",
icon: Mail,
},
];
Expand Down
12 changes: 7 additions & 5 deletions components/header.tsx → components/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ import { X, Menu } from "lucide-react";
import { cn } from "~/lib/utils";
import { useScrollDirection } from "~/hooks/useScrollDirection";

export const Header = () => {
export const Navbar = () => {
return (
<>
<HeaderMobile />
<HeaderDesktop />
<NavbarMobile />
<NavbarDesktop />
</>
);
};

const HeaderMobile = () => {
const NavbarMobile = () => {
const [isOpen, setIsOpen] = useState(false);
const scrollingDown = useScrollDirection();

Expand All @@ -28,6 +28,7 @@ const HeaderMobile = () => {
}`}
>
<Menu />
<span className="sr-only">Menu</span>
</button>

<div
Expand All @@ -47,6 +48,7 @@ const HeaderMobile = () => {
className="absolute right-4 top-4 rounded-full p-2 hover:bg-gray-100/10"
>
<X className="h-6 w-6 text-card-foreground" />
<span className="sr-only">Close</span>
</button>

<ul className="mt-12 space-y-4">
Expand Down Expand Up @@ -74,7 +76,7 @@ const HeaderMobile = () => {
);
};

const HeaderDesktop = () => {
const NavbarDesktop = () => {
const scrollingDown = useScrollDirection();

return (
Expand Down
2 changes: 1 addition & 1 deletion types/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ export type BrandLink = {
};

export type NavLink = {
href: string;
label: string;
href: string;
icon: React.ElementType;
};

Expand Down

0 comments on commit c4566b1

Please sign in to comment.