Simplify nav mapping
cgen-adc53c4a022e43e8808229ef2946eb67
This commit is contained in:
parent
55e471767b
commit
762bd4067e
1 changed files with 19 additions and 21 deletions
|
|
@ -84,27 +84,25 @@ export default function Layout({ children }: LayoutProps) {
|
||||||
|
|
||||||
{/* Navigation */}
|
{/* Navigation */}
|
||||||
<nav className="hidden md:flex items-center space-x-8">
|
<nav className="hidden md:flex items-center space-x-8">
|
||||||
{(() => {
|
{navItems.map((item, index) => (
|
||||||
const navItems = user ? userNavigation : navigation;
|
<Link
|
||||||
return navItems.map((item, index) => (
|
key={item.name}
|
||||||
<Link
|
to={item.href}
|
||||||
key={item.name}
|
onClick={scrollToTop}
|
||||||
to={item.href}
|
className={cn(
|
||||||
className={cn(
|
"relative text-sm font-medium transition-all duration-300 hover:text-aethex-400 hover:scale-105 animate-fade-in",
|
||||||
"text-sm font-medium transition-all duration-300 hover:text-aethex-400 hover:scale-105 relative animate-fade-in",
|
location.pathname === item.href
|
||||||
location.pathname === item.href
|
? "text-aethex-500 animate-pulse-glow"
|
||||||
? "text-aethex-500 animate-pulse-glow"
|
: "text-muted-foreground",
|
||||||
: "text-muted-foreground",
|
)}
|
||||||
)}
|
style={{ animationDelay: `${index * 0.1}s` }}
|
||||||
style={{ animationDelay: `${index * 0.1}s` }}
|
>
|
||||||
>
|
{item.name}
|
||||||
{item.name}
|
{location.pathname === item.href && (
|
||||||
{location.pathname === item.href && (
|
<div className="absolute -bottom-1 left-0 right-0 h-0.5 bg-gradient-to-r from-aethex-400 to-neon-blue animate-scale-in" />
|
||||||
<div className="absolute -bottom-1 left-0 right-0 h-0.5 bg-gradient-to-r from-aethex-400 to-neon-blue animate-scale-in" />
|
)}
|
||||||
)}
|
</Link>
|
||||||
</Link>
|
))}
|
||||||
));
|
|
||||||
})()}
|
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
{/* Auth Section */}
|
{/* Auth Section */}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue