From 3f2879d269e99874429f27723e0d717f2007fa29 Mon Sep 17 00:00:00 2001 From: "IGNY8 VPS (Salman)" Date: Mon, 8 Dec 2025 08:06:36 +0000 Subject: [PATCH] sad --- frontend/src/pages/Payment.tsx | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/frontend/src/pages/Payment.tsx b/frontend/src/pages/Payment.tsx index 3175567a..c647c34a 100644 --- a/frontend/src/pages/Payment.tsx +++ b/frontend/src/pages/Payment.tsx @@ -12,9 +12,16 @@ export default function Payment() { const navigate = useNavigate(); const [contactEmail, setContactEmail] = useState(""); const [note, setNote] = useState(""); + const [error, setError] = useState(""); const planSlug = useMemo(() => new URLSearchParams(location.search).get("plan") || "", [location.search]); const plan = planSlug ? PLAN_COPY[planSlug] : null; + const mailtoHref = useMemo(() => { + if (!plan || !contactEmail.trim()) return ""; + const subject = encodeURIComponent(`Subscribe to ${plan.name}`); + const body = encodeURIComponent(`Plan: ${plan.name}\nEmail: ${contactEmail}\nNotes: ${note || "-"}`); + return `mailto:sales@igny8.com?subject=${subject}&body=${body}`; + }, [plan, contactEmail, note]); useEffect(() => { if (!plan) { @@ -22,6 +29,20 @@ export default function Payment() { } }, [plan, navigate]); + const handleRequest = (e: React.MouseEvent) => { + if (!plan) { + e.preventDefault(); + navigate("/pricing", { replace: true }); + return; + } + if (!contactEmail.trim()) { + e.preventDefault(); + setError("Please enter a contact email."); + return; + } + setError(""); + }; + return (
@@ -74,14 +95,17 @@ export default function Payment() { Prefer the free plan? Start your trial Request payment instructions
+ {error &&

{error}

}
);