simplify: zakat yes/no per campaign, remove 5 fund types, add I've Donated button for external pledges
- Event.zakatEligible (boolean) replaces Organization.zakatEnabled + 5 fund types - Pledge.isZakat (boolean) replaces Pledge.fundType enum - Removed fundAllocation from Event (campaign IS the allocation) - Identity step: simple checkbox instead of 5-option grid - Campaign creation: Zakat toggle + optional external URL for self-payment - External redirect step: 'I've Donated' button calls /api/pledges/[id]/mark-initiated - Landing page: simplified Zakat section (toggle preview, not 5 fund descriptions) - Settings: removed org-level Zakat toggle (it's per campaign now) - Migration: ALTER TABLE adds zakatEligible/isZakat, drops fundAllocation
This commit is contained in:
@@ -22,7 +22,6 @@ interface OrgSettings {
|
||||
gcAccessToken: string
|
||||
gcEnvironment: string
|
||||
orgType: string
|
||||
zakatEnabled: boolean
|
||||
}
|
||||
|
||||
export default function SettingsPage() {
|
||||
@@ -118,42 +117,6 @@ export default function SettingsPage() {
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* Zakat & Fund Types */}
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle className="text-base flex items-center gap-2">☪️ Zakat & Fund Types</CardTitle>
|
||||
<CardDescription className="text-xs">Let donors specify their donation type (Zakat, Sadaqah, Lillah, Fitrana)</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
<button
|
||||
onClick={() => {
|
||||
setSettings(s => s ? { ...s, zakatEnabled: !s.zakatEnabled } : s)
|
||||
fetch("/api/settings", { method: "PATCH", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ zakatEnabled: !settings.zakatEnabled }) }).then(() => { setSaved("zakat"); setTimeout(() => setSaved(null), 2000) }).catch(() => {})
|
||||
}}
|
||||
className={`w-full flex items-center justify-between rounded-xl border-2 p-4 transition-all ${
|
||||
settings.zakatEnabled ? "border-trust-blue bg-trust-blue/5" : "border-gray-200"
|
||||
}`}
|
||||
>
|
||||
<div className="text-left">
|
||||
<p className="text-sm font-bold">{settings.zakatEnabled ? "Fund types enabled" : "Enable fund types"}</p>
|
||||
<p className="text-xs text-muted-foreground mt-0.5">Donors can choose: Zakat · Sadaqah · Lillah · Fitrana · General</p>
|
||||
</div>
|
||||
<div className={`w-11 h-6 rounded-full transition-colors ${settings.zakatEnabled ? "bg-trust-blue" : "bg-gray-200"}`}>
|
||||
<div className={`w-5 h-5 bg-white rounded-full shadow-sm mt-0.5 transition-transform ${settings.zakatEnabled ? "translate-x-5.5 ml-[22px]" : "translate-x-0.5 ml-[2px]"}`} />
|
||||
</div>
|
||||
</button>
|
||||
{settings.zakatEnabled && (
|
||||
<div className="rounded-xl bg-trust-blue/5 border border-trust-blue/10 p-3 space-y-1.5 text-xs text-muted-foreground animate-fade-in">
|
||||
<p>🌙 <strong>Zakat</strong> — Obligatory 2.5% annual charity</p>
|
||||
<p>🤲 <strong>Sadaqah / General</strong> — Voluntary donations</p>
|
||||
<p>🌱 <strong>Sadaqah Jariyah</strong> — Ongoing charity (buildings, wells)</p>
|
||||
<p>🕌 <strong>Lillah</strong> — For the mosque / institution</p>
|
||||
<p>🍽️ <strong>Fitrana</strong> — Zakat al-Fitr (before Eid)</p>
|
||||
</div>
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* Branding */}
|
||||
<Card>
|
||||
<CardHeader>
|
||||
|
||||
Reference in New Issue
Block a user