feat: add NavItem component
feat: add Header component with blur effect feat: first steps into dark- and light-mode support
This commit is contained in:
1 parent
c2f97547e5
commit
be9bd26c88
6 files changed
+58
-65
No files matched your search
@@ -0,0 +1,15 @@
|
||||
import NavItem from "./NavItem";
|
||||
|
||||
export default function Header() {
|
||||
return (
|
||||
<header className="fixed top-0 left-0 w-full z-50 p-4 flex justify-between items-center backdrop-blur-md">
|
||||
<div className="font-bold text-xl">PsalmTafel</div>
|
||||
<nav className="flex gap-4">
|
||||
<NavItem path="/">Dashboard</NavItem>
|
||||
<NavItem path="/sender">Sender</NavItem>
|
||||
<NavItem path="/receiver">Empfänger</NavItem>
|
||||
<NavItem path="/admin">Verwaltung</NavItem>
|
||||
</nav>
|
||||
</header>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
"use client";
|
||||
|
||||
import Link from "next/link";
|
||||
import { usePathname } from "next/navigation";
|
||||
import { ReactNode } from "react";
|
||||
|
||||
export default function NavItem({ path, children }: { path: string; children: ReactNode }) {
|
||||
const pathname = usePathname();
|
||||
const isActive = pathname === path;
|
||||
|
||||
return (
|
||||
<Link href={path} className={`px-3 py-1 rounded-full hover:bg-blue-300 ${isActive ? "underline" : ""}`}>
|
||||
{children}
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user