Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
feat(components): add Navbar component
Browse files Browse the repository at this point in the history
  ## what
  - add navbar
  - add links
  - add theme toggle
  - place navbar as `sticky` (will display on top when scrolling)

  ## how

  ## why

  ## where
  - ./src/components/navbar.tsx

  ## usage
  • Loading branch information
Clumsy-Coder committed Dec 31, 2023
1 parent ccd098f commit 27c1b8f
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/components/navbar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import Link from "next/link";

import { cn } from "@/lib/utils";
import { ModeToggle } from "@/components/darkmode-toggle";

const links = [{ label: "Uva uHunt", href: "/" }];

const Navbar = ({ className, ...props }: React.HTMLAttributes<HTMLElement>) => {
return (
<header className="flex flex-col justify-between md:flex border-b w-full sticky top-0 z-50 bg-background">
<nav
className={cn(
"flex h-16 justify-between items-center px-2 space-x-4",
className,
)}
{...props}
>
{links.map((link) => (
<Link
key={link.label}
href={link.href}
className="text-lg font-medium rounded-lg px-2 py-2 hover:bg-zinc-800 hover:underline"
>
{link.label}
</Link>
))}
<ModeToggle />
</nav>
</header>
);
};

export default Navbar;

0 comments on commit 27c1b8f

Please sign in to comment.