// Dedications page — checkbox form for all tiers, wired for Gravity Forms handoff const DedicationsPage = ({ onNav, formStyle }) => { const [selected, setSelected] = React.useState(new Set()); const [form, setForm] = React.useState({ name: '', email: '', phone: '', message: '' }); const [submitted, setSubmitted] = React.useState(false); const [submitting, setSubmitting] = React.useState(false); const [submitError, setSubmitError] = React.useState(''); React.useEffect(() => { if (window.lucide) lucide.createIcons(); }, [selected, submitted]); const toggle = (label) => { setSelected(prev => { const next = new Set(prev); if (next.has(label)) next.delete(label); else next.add(label); return next; }); }; const handleSubmit = async (e) => { e.preventDefault(); setSubmitError(''); setSubmitting(true); try { const res = await fetch('/wp-json/soul/v1/dedication', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ name: form.name, email: form.email, phone: form.phone, message: form.message, items: [...selected], }), }); const data = await res.json().catch(() => ({})); if (!res.ok || data.ok === false) { const msg = data?.message || (data?.data?.messages && Object.values(data.data.messages).join(' ')) || 'Submission failed. Please try again or call us.'; setSubmitError(msg); setSubmitting(false); return; } setSubmitted(true); window.scrollTo({ top: document.querySelector('.ded-form').offsetTop - 100, behavior: 'smooth' }); } catch (err) { setSubmitError('Network error. Please try again.'); } finally { setSubmitting(false); } }; const renderList = (items) => { const useThree = formStyle === 'compact' && items.length > 4; return (
{items.map(it => { const checked = selected.has(it.label); return ( ); })}
); }; return (

How it works

Select any number of opportunities below — there's no limit and no commitment yet. Share your contact info and our development team will reach out within two business days to walk you through pledge options, timing, and naming details.

Prefer to talk first?
Call (973) 251-0200
or email development@soulcenternj.com.

{SC_TIERS.map(tier => (

{tier.name}

{tier.description}

{renderList(tier.items)}
))}
{/* Form */}

Your dedication inquiry

{selected.size} {selected.size === 1 ? 'opportunity' : 'opportunities'} selected
{[...selected].map(label => ( {label} ))}
setForm({ ...form, name: e.target.value })} placeholder="Firstname Lastname" />
setForm({ ...form, email: e.target.value })} placeholder="you@example.com" />
setForm({ ...form, phone: e.target.value })} placeholder="(973) 555-1234" />