forked from 77media/video-flow
修复一些问题
This commit is contained in:
parent
b4d17d237b
commit
0e381bae0d
@ -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() {
|
||||
<p className="text-white text-[0.875rem] mb-[1rem]">
|
||||
{plan.credits}
|
||||
</p>
|
||||
{plan.issubscribed ? (
|
||||
<button
|
||||
disabled
|
||||
className="w-full bg-gray-400 text-gray-600 py-[0.75rem] rounded-full mb-[1rem] cursor-not-allowed border border-gray-300"
|
||||
>
|
||||
Already Owned
|
||||
</button>
|
||||
) : (
|
||||
<button
|
||||
onClick={() => handleSubscribe(plan.title)}
|
||||
className="w-full bg-white text-black py-[0.75rem] rounded-full mb-[1rem] hover:bg-black hover:text-white transition-colors border border-white/20"
|
||||
>
|
||||
{plan.buttonText}
|
||||
</button>
|
||||
)}
|
||||
<p className="w-full text-center text-white/60 text-[0.75rem] mb-[2rem]">
|
||||
* Billed monthly until cancelled
|
||||
</p>
|
||||
|
||||
@ -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"
|
||||
/>
|
||||
<label htmlFor="agreeToTerms" className="text-sm text-gray-300 leading-relaxed">
|
||||
I agree to the{" "}
|
||||
By registering, you agree to our{" "}
|
||||
<button
|
||||
type="button"
|
||||
onClick={handleTermsClick}
|
||||
|
||||
@ -569,6 +569,7 @@ function HomeModule5() {
|
||||
credits: string;
|
||||
buttonText: string;
|
||||
features: string[];
|
||||
issubscribed: boolean;
|
||||
}[]
|
||||
>(() => {
|
||||
return plans.map((plan) => {
|
||||
@ -580,6 +581,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 || [],
|
||||
};
|
||||
});
|
||||
@ -679,12 +681,21 @@ function HomeModule5() {
|
||||
<p className="text-white text-[0.875rem] mb-[1rem]">
|
||||
{plan.credits}
|
||||
</p>
|
||||
{plan.issubscribed ? (
|
||||
<button
|
||||
disabled
|
||||
className="w-full bg-gray-400 text-gray-600 py-[0.75rem] rounded-full mb-[1rem] cursor-not-allowed border border-gray-300"
|
||||
>
|
||||
Already Owned
|
||||
</button>
|
||||
) : (
|
||||
<button
|
||||
onClick={() => handleSubscribe(plan.title)}
|
||||
className="w-full bg-white text-black py-[0.75rem] rounded-full mb-[1rem] hover:bg-black hover:text-white transition-colors border border-white/20"
|
||||
>
|
||||
{plan.buttonText}
|
||||
</button>
|
||||
)}
|
||||
<p className="w-full text-center text-white/60 text-[0.75rem] mb-[2rem]">
|
||||
* Billed monthly until cancelled
|
||||
</p>
|
||||
|
||||
@ -380,7 +380,7 @@ export const registerUser = async ({
|
||||
const data = await response.json();
|
||||
console.log('data', data)
|
||||
if(!data.success){
|
||||
throw new Error(data.message)
|
||||
throw new Error(data.msg)
|
||||
}
|
||||
return data as {
|
||||
success: boolean;
|
||||
|
||||
@ -14,6 +14,7 @@ export interface SubscriptionPlan {
|
||||
features: string[];
|
||||
is_free: boolean;
|
||||
is_popular: boolean;
|
||||
is_subscribed: boolean;
|
||||
sort_order: number;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user