/* global React, window, Icon, Mascot, Reveal, Counter, FloatingDeco, TeacherPortrait, useT, TEACHERS, STATS */ const { useState, useEffect, useRef } = React; // ============================================================ // LEARNING JOURNEY // ============================================================ function Journey() { const t = useT(); return ( {t.journey.eyebrow} {t.journey.titleA}{t.journey.titleB} {t.journey.lead} {t.journey.steps.map((s, i) => ( {s.num} {s.title} {s.desc} ))} ); } // ============================================================ // TEACHERS — with portrait illustrations // ============================================================ const TEACHER_PORTRAIT_STYLES = ["gold", "navy", "purple", "warm"]; function Teachers() { const t = useT(); return ( {t.teachers.eyebrow} {t.teachers.titleA}{t.teachers.titleB} {t.teachers.lead} {TEACHERS.map((tr, i) => { const loc = t.teachers.names[tr.initials] || { name: tr.name, subj: tr.subj }; const portraitStyle = TEACHER_PORTRAIT_STYLES[i % TEACHER_PORTRAIT_STYLES.length]; return ( {t.teachers.verified} {loc.name} {loc.subj} {tr.years} {t.teachers.years} {tr.students.toLocaleString()} {t.teachers.students} ); })} ); } // ============================================================ // ACHIEVEMENTS // ============================================================ function Achievements() { const t = useT(); return ( {t.achievements.eyebrow} {t.achievements.titleA}{t.achievements.titleB} {t.achievements.lead} {STATS.map((s, i) => ( {t.achievements.statLabels[i]} ))} Certificate of Achievement {t.achievements.cert.kicker} {t.achievements.cert.student} {t.achievements.cert.body1} {t.achievements.cert.body2} {t.achievements.cert.grade} {t.achievements.cert.sig}{t.achievements.cert.date} {t.achievements.rightTitleA} {t.achievements.rightTitleB} {t.achievements.rightLead} {t.achievements.bullets.map((text, i) => ( {text} ))} ); } // ============================================================ // TESTIMONIALS // ============================================================ function Testimonials() { const t = useT(); const { lang } = window.useEyad(); const trackRef = useRef(null); const scroll = (dir) => { const tr = trackRef.current; if (!tr) return; const amount = 444 * dir; const sign = lang === "ar" ? -1 : 1; tr.scrollBy({ left: sign * amount, behavior: "smooth" }); }; return ( {t.stories.eyebrow} {t.stories.titleA}{t.stories.titleB} {t.stories.lead} {t.testimonials.map((it, i) => ( {"★★★★★"} " {it.body} {it.initials} {it.name} {it.role} ))} scroll(1)} aria-label={t.stories.prev}> scroll(-1)} aria-label={t.stories.next} style={{ transform: "scaleX(-1)" }}> ); } // ============================================================ // CTA + signup form // ============================================================ function CTA({ mascotStyle, signupRef }) { const t = useT(); const [form, setForm] = useState({ studentName: "", age: "", parentEmail: "", subject: "all" }); const [errs, setErrs] = useState({}); const [submitted, setSubmitted] = useState(false); const onSubmit = (e) => { e.preventDefault(); const newErr = {}; if (!form.studentName.trim()) newErr.studentName = t.cta.errors.name; if (!form.age || Number(form.age) < 4 || Number(form.age) > 17) newErr.age = t.cta.errors.age; if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(form.parentEmail)) newErr.parentEmail = t.cta.errors.email; setErrs(newErr); if (Object.keys(newErr).length === 0) setSubmitted(true); }; return ( {t.cta.eyebrow} {t.cta.titleA}{t.cta.titleB} {t.cta.body} {t.cta.bullets.map((b) => ( {b} ))} {submitted ? ( {t.cta.success.title} {t.cta.success.body1}{t.cta.success.body2} { setSubmitted(false); setForm({ studentName: "", age: "", parentEmail: "", subject: "all" }); }}> {t.cta.success.again} ) : ( {t.cta.formTitle} {t.cta.labels.name} setForm({ ...form, studentName: e.target.value })}/> {errs.studentName && {errs.studentName}} {t.cta.labels.age} setForm({ ...form, age: e.target.value })}/> {t.cta.labels.subject} setForm({ ...form, subject: e.target.value })}> {t.cta.subjectOpts.all} {t.cta.subjectOpts.quran} {t.cta.subjectOpts.arabic} {t.cta.subjectOpts.math} {t.cta.subjectOpts.science} {errs.age && {errs.age}} {t.cta.labels.email} setForm({ ...form, parentEmail: e.target.value })}/> {errs.parentEmail && {errs.parentEmail}} {t.cta.submit} {t.cta.micro} {t.cta.terms} {t.cta.and} {t.cta.privacy} )} ); } // ============================================================ // FOOTER // ============================================================ function Footer() { const t = useT(); return ( ); } Object.assign(window, { Journey, Teachers, Achievements, Testimonials, CTA, Footer });
{t.journey.lead}
{s.desc}
{t.teachers.lead}
{t.achievements.lead}
{t.achievements.rightLead}
{t.stories.lead}
{it.body}
{t.cta.body}
{t.cta.success.body1}{t.cta.success.body2}