/* chrome.jsx — Navbar, Footer, ConsultationDrawer, ConsultBar, WhatsAppFab */
const Navbar = ({route, setRoute, onOpenConsult, locale, setLocale}) => {
const [megaOpen, setMegaOpen] = React.useState(null); // 'collections' | 'bespoke' | null
const closeAll = () => setMegaOpen(null);
return (
setMegaOpen('collections')}
onClick={() => { setRoute('home'); closeAll(); }}>
Collections
{ setRoute('product'); }}>
Signature
{ setRoute('bespoke'); closeAll(); }}>
Bespoke
{ setRoute('home'); setTimeout(() => { document.getElementById('heritage')?.scrollIntoView({block: 'start'}); }, 50); }}>
Heritage
{ setRoute('home'); setTimeout(() => { document.getElementById('visit')?.scrollIntoView({block: 'start'}); }, 50); }}>
Visit
setLocale(locale === 'en' ? 'ar' : 'en')}
title="Toggle EN / AR">
{locale === 'en' ? 'EN · العربية' : 'العربية · EN'}
Book a Private Consultation
{megaOpen === 'collections' && (
{ setRoute('home'); closeAll(); setTimeout(() => document.getElementById('collections')?.scrollIntoView({block: 'start'}), 50); }} />
{ setRoute('home'); closeAll(); }} />
From the Atelier
The Aureveris
A constellation of multi-coloured sapphires set in 18k rose gold.
{ setRoute('product'); closeAll(); }}>Discover the piece →
)}
);
};
const MegaColumn = ({title, items, onPick}) => (
{title}
{items.map((i) => (
onPick && onPick(i)} style={{
background: 'transparent', border: 0, padding: 0,
color: 'var(--charcoal)', fontSize: 14, fontFamily: 'inherit',
cursor: 'pointer', textAlign: 'left',
}}>{i}
))}
);
// ===========================================================
// Consultation Drawer (multi-step)
// ===========================================================
const ConsultationDrawer = ({open, onClose, prefill}) => {
const [step, setStep] = React.useState(0);
const [data, setData] = React.useState({
occasion: prefill?.occasion || '',
piece: prefill?.piece || '',
budget: '',
metal: '',
showroom: 'gate-3',
name: '', email: '', phone: '', date: '', message: '',
});
React.useEffect(() => { if (open) { setStep(0); } }, [open]);
if (!open) return null;
const set = (k, v) => setData((d) => ({...d, [k]: v}));
const occasions = ['Engagement', 'Wedding Band', 'Anniversary', 'Gift', 'A piece for myself', 'Bespoke commission'];
const budgets = ['AED 9k–20k', 'AED 20k–50k', 'AED 50k–100k', 'AED 100k+', 'Open'];
const metals = ['Yellow Gold', 'White Gold', 'Rose Gold', 'Platinum', 'Mixed / Advise me'];
const steps = [
{ title: 'The occasion', body: (
So we know whom to seat you with.
{occasions.map((o) => (
set('occasion', o)}>{o}
))}
{prefill?.piece && (
Piece in mind
{byId(prefill.piece)?.name}
)}
)},
{ title: 'Budget & metal', body: (
Comfortable budget
{budgets.map((b) => (
set('budget', b)}>{b}
))}
Preferred metal
{metals.map((m) => (
set('metal', m)}>{m}
))}
)},
{ title: 'Where & when', body: (
)},
{ title: 'Your details', body: (
)},
{ title: 'Booked', body: (
Thank you, {data.name?.split(' ')[0] || 'we have you'}.
A consultant from our {data.showroom === 'gate-1' ? 'Gate 1' : data.showroom === 'gate-3' ? 'Gate 3' : 'Virtual'} room will be in touch within the working day. We'll reserve a private table and prepare a curated selection ahead of your visit.
Reference · PJ-{Math.random().toString(36).slice(2, 8).toUpperCase()}
)},
];
const isLast = step === steps.length - 1;
const canAdvance = (() => {
if (step === 0) return !!data.occasion;
if (step === 1) return !!data.budget && !!data.metal;
if (step === 2) return !!data.showroom;
if (step === 3) return !!data.name && (data.email || data.phone);
return true;
})();
return (
Private Consultation
{steps[step].title}
{!isLast && (
{steps.slice(0, -1).map((_, i) => (
))}
)}
{steps[step].body}
{!isLast && (
step > 0 ? setStep(step - 1) : onClose()}>
{step === 0 ? 'Cancel' : '← Back'}
setStep(step + 1)} style={{opacity: canAdvance ? 1 : 0.4}}>
{step === 3 ? 'Confirm Booking' : 'Continue'}
)}
{isLast && (
Close
)}
);
};
// ===========================================================
// WhatsApp FAB
// ===========================================================
const WhatsAppFab = () => (
);
// ===========================================================
// Sticky consult bar
// ===========================================================
const ConsultBar = ({onOpen}) => {
const [visible, setVisible] = React.useState(false);
React.useEffect(() => {
const onScroll = () => setVisible(window.scrollY > 600);
onScroll();
window.addEventListener('scroll', onScroll, {passive: true});
return () => window.removeEventListener('scroll', onScroll);
}, []);
if (!visible) return null;
return (
Private consultation · Gold Souk, Deira
Book →
);
};
// ===========================================================
// Footer
// ===========================================================
const Footer = () => (
);
const FooterCol = ({title, items}) => (
);
Object.assign(window, { Navbar, ConsultationDrawer, WhatsAppFab, ConsultBar, Footer });