// W2Go screens — Onboarding flow: Splash, Onboarding, Location, Auth const { useState: useStateA, useEffect: useEffectA, useRef: useRefA, useMemo: useMemoA } = React; // ─────────────────────────────────────────────────────────────── // 1. SPLASH // ─────────────────────────────────────────────────────────────── function SplashScreen({ go }) { useEffectA(() => { const t = setTimeout(() => go('onboarding'), 2600); return () => clearTimeout(t); }, []); return (
go('onboarding')} style={{ position: 'absolute', inset: 0, background: 'var(--w-onyx)', display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', color: 'var(--w-cream)', overflow: 'hidden', textAlign: 'center', }}> {/* subtle brand pattern background */}
CRAVINGS · DON'T · WAIT
v1.0 · DOHA, QATAR
); } // ─────────────────────────────────────────────────────────────── // 2. ONBOARDING (3 cards) // ─────────────────────────────────────────────────────────────── const ONBOARDING = [ { eyebrow: 'WELCOME TO W2GO', title: 'Taste every\ncraving.', body: 'Sushi, bowls, hot bites — crafted in the W Doha kitchen and sealed for the road.', tone: 'cream', img: 'assets/hero-craving.jpg', }, { eyebrow: 'FLAVOR ON THE MOVE', title: 'From the W\nto your door\nin 30.', body: 'One outlet. No third-party. We cook, pack, and dispatch in a single continuous flow.', tone: 'green', img: 'assets/hero-marketing.jpg', }, { eyebrow: 'CRAFTED BY W DOHA', title: 'Cravings\ndon\u2019t wait.', body: 'Save the order, reorder in two taps, rate the rider. Every craving lives in one app.', tone: 'onyx', img: 'assets/box-with-sushi.jpg', }, ]; function OnboardingScreen({ go }) { const [i, setI] = useStateA(0); const step = ONBOARDING[i]; const next = () => i < ONBOARDING.length - 1 ? setI(i + 1) : go('location'); const dark = step.tone !== 'cream'; return (
{/* skip */}
{step.eyebrow}
{step.title}
{step.body}
{/* dots */}
{ONBOARDING.map((_, idx) => ( ))}
}> {i === ONBOARDING.length - 1 ? 'Get started' : 'Next'}
); } // ─────────────────────────────────────────────────────────────── // 3. LOCATION // ─────────────────────────────────────────────────────────────── function LocationScreen({ go, setAddress }) { const [q, setQ] = useStateA(''); const filtered = W2_ADDRESSES.filter(a => !q || (a.line + ' ' + a.city + ' ' + a.label).toLowerCase().includes(q.toLowerCase()) ); const pick = (a) => { setAddress(a); go('auth'); }; return (
{/* Map placeholder hero */}
{/* fake roads */} {/* pin */}
Where to?
We deliver from the W2GO outlet within 4 miles.
setQ(e.target.value)} placeholder="Enter your delivery address" style={{ flex: 1, border: 'none', outline: 'none', background: 'transparent', fontFamily: 'inherit', fontSize: 15, color: 'var(--w-onyx)' }}/>
SAVED ADDRESSES
{filtered.map(a => ( ))} {filtered.length === 0 && (
No saved addresses match.
)}
); } // ─────────────────────────────────────────────────────────────── // 4. AUTH — Phone + OTP // ─────────────────────────────────────────────────────────────── function AuthScreen({ go, setUser }) { const [stage, setStage] = useStateA('phone'); // 'phone' | 'otp' | 'name' const [phone, setPhone] = useStateA(''); const [otp, setOtp] = useStateA(['', '', '', '']); const [name, setName] = useStateA(''); const validPhone = phone.replace(/\D/g, '').length >= 9; return (
stage === 'phone' ? go('location') : setStage('phone')}/>
{stage === 'phone' && <>
Let's get
you set.
One number. One tap. No passwords.
🇶🇦 +974 setPhone(e.target.value)} placeholder="5000 1234" inputMode="tel" style={{ flex: 1, border: 'none', outline: 'none', background: 'transparent', color: 'var(--w-cream)', fontFamily: 'inherit', fontSize: 17, fontWeight: 600, letterSpacing: 1 }}/>
setStage('otp')} kind="cream" iconRight={}>Continue
OR
} onClick={() => { setUser({ name: 'Friend', phone: '+974 5000 0000' }); go('home'); }}>Continue with Apple } onClick={() => { setUser({ name: 'Friend', phone: '+974 5000 0000' }); go('home'); }}>Continue with Google
By continuing you agree to W2GO's
Terms and Privacy Policy.
} {stage === 'otp' && <>
We sent a code.
4-digit code sent to +974 {phone}.
{otp.map((d, i) => (
{d || ''}
))}
{/* numeric pad */}
{[1,2,3,4,5,6,7,8,9,'',0,'<'].map((k, i) => ( ))}
} {stage === 'name' && <>
What should
we call you?
One field. We don't need a life story.
setName(e.target.value)} autoFocus placeholder="Your name" style={{ marginTop: 30, height: 60, borderRadius: 16, padding: '0 18px', background: 'rgba(255,255,255,0.08)', border: '1.5px solid rgba(255,255,255,0.12)', color: 'var(--w-cream)', fontFamily: 'inherit', fontSize: 18, fontWeight: 600, outline: 'none', }}/>
{ setUser({ name: name.trim() || 'Friend', phone: '+974 ' + phone }); go('home'); }} kind="cream" iconRight={}>Enter W2GO
}
); } Object.assign(window, { SplashScreen, OnboardingScreen, LocationScreen, AuthScreen });