// Alba Cars — Navbar, Footer, Mobile bar
const { useState, useEffect } = React;
function Navbar({ route, setRoute, dark }) {
const [scrolled, setScrolled] = useState(false);
const [open, setOpen] = useState(false);
useEffect(() => {
const onScroll = () => setScrolled(window.scrollY > 24);
window.addEventListener('scroll', onScroll, { passive: true });
return () => window.removeEventListener('scroll', onScroll);
}, []);
const onDark = dark && !scrolled;
const navItems = [
{ id: 'buy', label: 'Buy' },
{ id: 'brands', label: 'Brands' },
{ id: 'sell', label: 'Sell Your Car' },
{ id: 'finance', label: 'Finance' },
{ id: 'about', label: 'About' },
{ id: 'contact', label: 'Contact' },
];
return (
{/* Logo */}
{/* Nav */}
{/* Right side */}
1100 ? 'inline-flex' : 'none',
alignItems: 'center', gap: 8,
fontFamily: 'var(--f-display)', fontSize: 13, fontWeight: 500,
color: 'inherit',
}}>
+971 4 377 2503
{ setRoute('sell'); window.scrollTo({ top: 0 }); }}>
Sell Your Car
{open && setOpen(false)} route={route} setRoute={setRoute} items={navItems} />}
);
}
function MobileMenu({ close, route, setRoute, items }) {
return (
{items.map(n => (
))}
);
}
function Footer({ setRoute }) {
return (
);
}
function FooterContact({ icon, label, value }) {
return (
);
}
Object.assign(window, { Navbar, Footer });