// Medway MSS — Navigation + Hero function Nav({ active, onNav, accent, lang, setLang }) { const { t } = useI18n.cached || { t: (k) => k }; // We read t from props-less hook context — but components don't share React context here. // Simpler: accept t via prop. return null; } function NavReal({ active, onNav, accent, lang, setLang, t }) { const [scrolled, setScrolled] = React.useState(false); const isMobile = useIsMobile(); React.useEffect(() => { const onScroll = () => setScrolled(window.scrollY > 8); window.addEventListener('scroll', onScroll); return () => window.removeEventListener('scroll', onScroll); }, []); const items = [ { id: 'home', label: t('nav.home') }, { id: 'about', label: t('nav.about') }, { id: 'products', label: t('nav.products'), href: '/catalogue' }, { id: 'industries', label: t('nav.industries') }, { id: 'contact', label: t('nav.contact') }, ]; return ( { e.preventDefault(); onNav('home'); }} style={{ textDecoration: 'none', display: 'inline-flex' }}> {items.map((it) => { const isActive = active === it.id; return ( { if (it.href) return; e.preventDefault(); onNav(it.id); }} style={{ position: 'relative', padding: '8px 14px', fontFamily: 'Inter, sans-serif', fontSize: 13.5, fontWeight: 500, color: isActive ? 'var(--fg-1)' : 'var(--fg-2)', textDecoration: 'none', letterSpacing: '-0.005em', transition: 'color 150ms ease', }} > {it.label} {isActive && ( )} ); })} {isMobile && ( {t('nav.products')} )} { e.preventDefault(); onNav('contact'); }} style={{ display: isMobile ? 'none' : 'inline-flex', alignItems: 'center', gap: 6, padding: isMobile ? '8px 10px' : '9px 16px', fontFamily: 'Inter, sans-serif', fontSize: isMobile ? 12.5 : 13.5, fontWeight: 500, color: '#fff', background: 'var(--fg-1)', borderRadius: 6, textDecoration: 'none', transition: 'background 150ms ease', }}> {t('nav.cta')} ); } function Hero({ accent, onNav, t }) { const isMobile = useIsMobile(); return ( {/* Brand-color soft wash on the right */} {t('hero.eyebrow')} {t('hero.compliance')} {t('hero.title.1')} {t('hero.title.2')} {t('hero.title.accent')} {t('hero.title.3')} {t('hero.subhead')} {t('hero.cta.primary')} onNav('contact')} style={{ padding: '14px 22px', fontFamily: 'Inter, sans-serif', fontSize: 14, fontWeight: 500, color: 'var(--fg-1)', background: 'transparent', border: '1px solid var(--border-strong)', borderRadius: 6, cursor: 'pointer', display: 'inline-flex', justifyContent: 'center', }}> {t('hero.cta.secondary')} {[1, 2, 3, 4].map((n, i) => ( {t(`hero.stats.${n}.k`)} {t(`hero.stats.${n}.l`)} ))} {t('hero.serving')} {[1, 2, 3, 4, 5].map((n) => ( {t(`hero.serving.${n}`)} ))} ); } Object.assign(window, { Nav: NavReal, Hero });
{t('hero.subhead')}