import { NavLink, useLocation } from 'react-router-dom'; import { useEffect, useState } from 'react'; const navItems = [ { to: '/discover', label: 'Discover', icon: ( ), }, { to: '/likes', label: 'Likes', icon: ( ), }, { to: '/messages', label: 'Chat', icon: ( ), }, { to: '/sent-pings', label: 'Pings', icon: ( ), }, { to: '/okcupid', label: 'OKC', icon: ( OK ), }, { to: '/matches', label: 'Matches', icon: ( ), }, { to: '/profile', label: 'Profile', icon: ( ), }, { to: '/settings', label: 'Settings', icon: ( ), }, ]; const s = { // Desktop side rail desktop: { position: 'fixed' as const, left: 0, top: 0, bottom: 0, width: '80px', display: 'flex', flexDirection: 'column' as const, alignItems: 'center', paddingTop: '24px', paddingBottom: '24px', zIndex: 50, background: 'var(--color-void)', borderRight: '1px solid rgba(255,255,255,0.04)', }, desktopLogo: { width: '40px', height: '40px', borderRadius: '12px', background: 'var(--gradient-desire)', display: 'flex', alignItems: 'center', justifyContent: 'center', marginBottom: '32px', boxShadow: '0 4px 16px rgba(124,58,237,0.3)', }, desktopLogoText: { color: '#fff', fontFamily: "var(--font-display)", fontWeight: 700, fontSize: '18px', }, desktopNavList: { display: 'flex', flexDirection: 'column' as const, gap: '4px', flex: 1, }, desktopLink: (active: boolean) => ({ position: 'relative' as const, width: '48px', height: '48px', display: 'flex', alignItems: 'center', justifyContent: 'center', borderRadius: '14px', color: active ? '#fff' : 'rgba(255,255,255,0.38)', background: active ? 'rgba(124,58,237,0.12)' : 'transparent', border: active ? '1px solid rgba(124,58,237,0.20)' : '1px solid transparent', transition: 'all 250ms cubic-bezier(0.22,1,0.36,1)', cursor: 'pointer', textDecoration: 'none', }), desktopTooltip: { position: 'absolute' as const, left: '100%', marginLeft: '12px', padding: '6px 12px', borderRadius: '8px', background: 'var(--color-surface-elevated)', border: '1px solid rgba(255,255,255,0.06)', fontSize: '13px', fontWeight: 500, color: 'rgba(255,255,255,0.87)', whiteSpace: 'nowrap' as const, pointerEvents: 'none' as const, opacity: 0, transform: 'translateX(4px)', transition: 'all 200ms cubic-bezier(0.22,1,0.36,1)', }, desktopActiveDot: { position: 'absolute' as const, right: '-4px', width: '6px', height: '6px', borderRadius: '50%', background: 'var(--color-desire)', boxShadow: '0 0 8px rgba(124,58,237,0.5)', }, // Mobile bottom bar mobile: { position: 'fixed' as const, bottom: 0, left: 0, right: 0, zIndex: 50, background: 'rgba(18,18,18,0.82)', backdropFilter: 'blur(24px) saturate(180%)', WebkitBackdropFilter: 'blur(24px) saturate(180%)', borderTop: '1px solid rgba(255,255,255,0.06)', paddingBottom: 'env(safe-area-inset-bottom, 0px)', }, mobileInner: { display: 'flex', justifyContent: 'space-around', alignItems: 'center', height: '56px', padding: '0 4px', }, mobileLink: (active: boolean) => ({ display: 'flex', flexDirection: 'column' as const, alignItems: 'center', justifyContent: 'center', gap: '2px', width: '64px', height: '48px', borderRadius: '12px', color: active ? 'var(--color-desire)' : 'rgba(255,255,255,0.38)', background: active ? 'rgba(124,58,237,0.10)' : 'transparent', transition: 'all 200ms cubic-bezier(0.22,1,0.36,1)', textDecoration: 'none', WebkitTapHighlightColor: 'transparent', userSelect: 'none' as const, WebkitUserSelect: 'none' as const, }), mobileLabel: (active: boolean) => ({ fontSize: '10px', fontWeight: active ? 600 : 500, fontFamily: 'var(--font-body)', lineHeight: 1, letterSpacing: '0.02em', }), mobileIconWrap: (active: boolean) => ({ transition: 'transform 200ms cubic-bezier(0.22,1,0.36,1)', transform: active ? 'scale(1.1)' : 'scale(1)', display: 'flex', }), }; export function Navigation() { const location = useLocation(); const [isMobile, setIsMobile] = useState(window.innerWidth < 768); const [hovered, setHovered] = useState(null); useEffect(() => { const onResize = () => setIsMobile(window.innerWidth < 768); window.addEventListener('resize', onResize); return () => window.removeEventListener('resize', onResize); }, []); const isActive = (to: string) => location.pathname === to || (to === '/discover' && location.pathname === '/'); if (isMobile) { return ( {navItems.map((item) => { const active = isActive(item.to); return ( {item.icon} {item.label} ); })} ); } return ( F {navItems.map((item) => { const active = isActive(item.to); return ( setHovered(item.to)} onMouseLeave={() => setHovered(null)} > {item.icon} {active && } {item.label} ); })} ); }