/* global React, Placeholder, Reveal */ const { useState: useCS } = React; function ContactPage() { const [form, setForm] = useCS({ name: "", email: "", phone: "", childAge: "", message: "" }); const [errs, setErrs] = useCS({}); const [done, setDone] = useCS(false); const [sending, setSending] = useCS(false); const [sendErr, setSendErr] = useCS(""); const update = (k) => (e) => setForm({ ...form, [k]: e.target.value }); const submit = (e) => { e.preventDefault(); const er = {}; if (!form.name.trim()) er.name = "Please share your name"; if (!form.email.trim() || !form.email.includes("@")) er.email = "Valid email required"; if (!form.message.trim()) er.message = "Tell us a little about what you need"; setErrs(er); if (Object.keys(er).length !== 0) return; setSending(true); setSendErr(""); fetch(window.FORMSPREE_ENDPOINT, { method: "POST", headers: { "Content-Type": "application/json", Accept: "application/json" }, body: JSON.stringify({ _subject: "Message — Agape website", ...form }) }).then((r) => { setSending(false); if (r.ok) setDone(true); else setSendErr("Something went wrong. Please call us at (806) 701-7946."); }).catch(() => { setSending(false); setSendErr("Something went wrong. Please call us at (806) 701-7946."); }); }; return (
The best way to know if Agape is right for your family is to walk through the door. Tours take about 30 minutes. Bring your child — we'd love to meet them too.
Pick a time that works for you — it takes about a minute.
Book on our calendarThank you, {form.name.split(" ")[0]}. We'll be in touch within one business day.