v1.2 - added react router
This commit is contained in:
parent
c83ff25a36
commit
b0fba52c0e
28 changed files with 4318 additions and 993 deletions
89
src/pages/Giving.tsx
Normal file
89
src/pages/Giving.tsx
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
import { useEffect } from "react";
|
||||
import PageShell from "../components/PageShell.tsx";
|
||||
|
||||
const GIVING_URL =
|
||||
"https://ngu.churchcenteronline.com/giving?open-in-church-center-modal=true";
|
||||
|
||||
const MODAL_SCRIPT_SRC = "https://js.churchcenter.com/modal/v1";
|
||||
|
||||
const ACCENT = "#138ba0";
|
||||
|
||||
function useChurchCenterModal() {
|
||||
useEffect(() => {
|
||||
if (document.querySelector(`script[src="${MODAL_SCRIPT_SRC}"]`)) return;
|
||||
|
||||
const script = document.createElement("script");
|
||||
script.src = MODAL_SCRIPT_SRC;
|
||||
script.async = true;
|
||||
document.head.appendChild(script);
|
||||
|
||||
// Deliberately not removed on unmount: the script registers a
|
||||
// document-level click handler, and tearing it down on every
|
||||
// route change would mean re-fetching it on the way back.
|
||||
}, []);
|
||||
}
|
||||
|
||||
/* ═══════════════════════════════════════════════════════════════
|
||||
GIVING SECTION
|
||||
═══════════════════════════════════════════════════════════════ */
|
||||
|
||||
function GivingPanel() {
|
||||
return (
|
||||
<div className="max-w-2xl mx-auto px-6 text-center">
|
||||
<p className="text-slate-700 leading-relaxed">
|
||||
Gifts are processed securely through Church Center. The form opens
|
||||
right here on the page and you can give once or set up a recurring
|
||||
gift, and you don’t need an account to do either.
|
||||
</p>
|
||||
|
||||
<a
|
||||
href={GIVING_URL}
|
||||
className="
|
||||
mt-8 inline-flex items-center justify-center
|
||||
rounded-full px-10 py-4
|
||||
text-base font-semibold tracking-wide text-white
|
||||
shadow-sm transition
|
||||
hover:brightness-110 hover:shadow-md
|
||||
focus-visible:outline-none focus-visible:ring-2
|
||||
focus-visible:ring-offset-2
|
||||
motion-reduce:transition-none
|
||||
"
|
||||
style={{ backgroundColor: ACCENT, "--tw-ring-color": ACCENT } as React.CSSProperties}
|
||||
>
|
||||
Give now
|
||||
</a>
|
||||
|
||||
<p className="mt-4 text-sm text-slate-500">
|
||||
If you would like to send a check, please email our Board Treasurer at treasurer@nextgenerationofunity.org to get an address.
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
/* ═══════════════════════════════════════════════════════════════
|
||||
PAGE
|
||||
═══════════════════════════════════════════════════════════════ */
|
||||
|
||||
export default function GivingPage() {
|
||||
useChurchCenterModal();
|
||||
|
||||
const sections = [
|
||||
{
|
||||
id: "give",
|
||||
title: "Donate to NGU",
|
||||
blurb:
|
||||
"Your giving funds scholarships, retreats, leadership development and the continued growth of the Next Generation of Unity leaders, teachers and community members.",
|
||||
accent: ACCENT,
|
||||
background: "#eef9fb",
|
||||
content: <GivingPanel />,
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<PageShell
|
||||
title="Giving"
|
||||
intro="Support the work of Next Generation of Unity."
|
||||
sections={sections}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue