const WHATSAPP_NUMBER = '5491133720000'; function Contact({ theme, t, contactRef }) { const [form, setForm] = React.useState({ name: '', email: '', interest: t.contact.interests[0], message: '' }); const [sent, setSent] = React.useState(false); const submit = (e) => { e.preventDefault(); const greet = t.ui.whatsappGreet || 'Β‘Hola La Salsera!'; const intro = t.ui.whatsappIntro || 'Soy'; const interest = t.ui.whatsappInterest || 'Me interesa'; const emailLabel = t.ui.whatsappEmail || 'mi email'; const lines = [ `${greet} π`, ``, `${intro} ${form.name}.`, `${interest}: ${form.interest}.`]; if (form.message.trim()) { lines.push(``, form.message.trim()); } lines.push(``, `(${emailLabel}: ${form.email})`); const text = encodeURIComponent(lines.join('\n')); const url = `https://wa.me/${WHATSAPP_NUMBER}?text=${text}`; window.open(url, '_blank', 'noopener,noreferrer'); setSent(true); setTimeout(() => setSent(false), 4000); }; return ( {t.contact.kicker} {t.contact.title} {/* Location */} {t.ui.addressLabel} {t.contact.address} {t.contact.hoursTitle} {t.contact.hoursLine} {[ { name: 'WhatsApp', icon: 'assets/social/whatsapp.png', url: 'https://wa.me/message/LNRZZI7DNWANB1' }, { name: 'Instagram', icon: 'assets/social/instagram.png', url: 'https://www.instagram.com/lasalseracom/' }, { name: 'Facebook', icon: 'assets/social/facebook.png', url: 'https://www.facebook.com/lasalsera.multiespacioafrolatino' }, { name: 'YouTube', icon: 'assets/social/youtube.png', url: 'https://www.youtube.com/user/lasalseracom' }, { name: 'TikTok', icon: 'assets/social/tiktok.png', url: 'https://www.tiktok.com/@lasalseracom' }]. map((s) => e.currentTarget.style.transform = 'scale(1.08)'} onMouseLeave={(e) => e.currentTarget.style.transform = 'none'} > )} {/* Form */} {t.contact.formTitle} {t.contact.formLead} setForm({ ...form, name: e.target.value })} style={inputStyle(theme)} /> setForm({ ...form, email: e.target.value })} style={inputStyle(theme)} /> {t.contact.interests.map((opt) => { const active = form.interest === opt; return ( setForm({ ...form, interest: opt })} style={{ padding: '8px 14px', background: active ? theme.accent : 'transparent', color: active ? theme.bg : theme.ink, border: `1px solid ${active ? theme.accent : theme.line}`, borderRadius: theme.radius, fontFamily: theme.body, fontSize: '13px', cursor: 'pointer' }}>{opt}); })} setForm({ ...form, message: e.target.value })} style={{ ...inputStyle(theme), resize: 'vertical', minHeight: '72px' }} /> {sent ? 'β ' + t.contact.sent : t.contact.fields.send + ' β'} ); } function Field({ label, children, theme }) { return ( {label} {children} ); } function inputStyle(theme) { return { padding: '12px 14px', background: 'transparent', border: `1px solid ${theme.line}`, borderRadius: theme.radius, fontFamily: theme.body, fontSize: '15px', color: theme.ink, outline: 'none' }; } function Footer({ theme, t }) { return ( ); } Object.assign(window, { Contact, Footer });
{t.contact.formLead}