From 0e381bae0db8e63cd596f2103d052fb083bf0235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=B7=E9=BE=99?= Date: Sat, 30 Aug 2025 14:55:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=BA=9B=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/pricing/page.tsx | 23 +++++++++++++++++------ app/signup/page.tsx | 6 +++--- components/pages/home-page2.tsx | 23 +++++++++++++++++------ lib/auth.ts | 2 +- lib/stripe.ts | 1 + 5 files changed, 39 insertions(+), 16 deletions(-) diff --git a/app/pricing/page.tsx b/app/pricing/page.tsx index 4dc2e9f..f653543 100644 --- a/app/pricing/page.tsx +++ b/app/pricing/page.tsx @@ -83,6 +83,7 @@ function HomeModule5() { credits: string; buttonText: string; features: string[]; + issubscribed: boolean; }[] >(() => { return plans.map((plan) => { @@ -94,6 +95,7 @@ function HomeModule5() { : plan.price_year / 100, credits: plan.description, buttonText: plan.is_free ? "Try For Free" : "Subscribe Now", + issubscribed: plan.is_subscribed, features: plan.features || [], }; }); @@ -191,12 +193,21 @@ function HomeModule5() {

{plan.credits}

- + {plan.issubscribed ? ( + + ) : ( + + )}

* Billed monthly until cancelled

diff --git a/app/signup/page.tsx b/app/signup/page.tsx index 89451d8..3cbe790 100644 --- a/app/signup/page.tsx +++ b/app/signup/page.tsx @@ -124,7 +124,7 @@ export default function SignupPage() { router.push("/login?registered=true"); } catch (error: any) { console.error("Signup error:", error); - setFormError(error.message || "Registration failed, please try again"); + setFormError(error.msg || "Registration failed, please try again"); } finally { setIsSubmitting(false); } @@ -301,10 +301,10 @@ export default function SignupPage() { id="agreeToTerms" checked={agreeToTerms} onChange={(e) => setAgreeToTerms(e.target.checked)} - className="mt-1 w-4 h-4 text-purple-600 bg-black/30 border-white/20 rounded focus:ring-purple-500 focus:ring-2" + className="cursor-pointer mt-1 w-4 h-4 text-purple-600 bg-black/30 border-white/20 rounded focus:ring-purple-500 focus:ring-2" />