Introduce RechtsgebietePage and SubpageHero components; enhance Navbar with active route and "Rechtsgebiete" link.

This commit is contained in:
2025-06-22 18:46:20 +09:00
parent caea958dc3
commit 9052cab43d
3 changed files with 108 additions and 2 deletions

View File

@@ -3,9 +3,13 @@
import {useEffect, useState} from 'react';
import Link from 'next/link';
import Links from '@/app/Links';
import {usePathname} from 'next/navigation';
export default function Navbar() {
const [scrolled, setScrolled] = useState(false);
const pathname = usePathname();
const isRoot = pathname === '/';
useEffect(() => {
const handleScroll = () => {
@@ -15,10 +19,12 @@ export default function Navbar() {
return () => window.removeEventListener('scroll', handleScroll);
}, []);
const isActiveScrolled = scrolled || !isRoot;
return (
<nav
className={`fixed top-0 left-0 right-0 z-50 transition-colors duration-300 px-6 md:px-12 lg:px-24 py-5 ${
scrolled
isActiveScrolled
? 'bg-white text-gray-900 shadow-md'
: 'bg-transparent text-white'
}`}
@@ -29,8 +35,9 @@ export default function Navbar() {
</Link>
<div className="space-x-6 text-base md:text-lg font-semibold">
<Link href={Links.about}>Über uns</Link>
<Link href={Links.legalFields}>Rechtsgebiete</Link>
</div>
</div>
</nav>
);
}
}