From 86292da5310bb7dde29398c7df44f161007fa095 Mon Sep 17 00:00:00 2001 From: hailin Date: Fri, 14 Mar 2025 19:46:57 +0800 Subject: [PATCH] . --- .../app/[locale]/auth/sign-up/mix-signup.tsx | 25 +++++-------------- apps/blogai/locales/en/common.json | 3 ++- apps/blogai/locales/zh-CN/common.json | 4 +-- 3 files changed, 10 insertions(+), 22 deletions(-) diff --git a/apps/blogai/app/[locale]/auth/sign-up/mix-signup.tsx b/apps/blogai/app/[locale]/auth/sign-up/mix-signup.tsx index 5c2db3b..3dfc3c4 100644 --- a/apps/blogai/app/[locale]/auth/sign-up/mix-signup.tsx +++ b/apps/blogai/app/[locale]/auth/sign-up/mix-signup.tsx @@ -88,13 +88,13 @@ export function MixSignUp(props: { setTransferLoading(false); }, []); - const signUpWithCode = async (email: string, password: string) => { + const signUpWithCode = async (username: string, password: string) => { - console.log("-------------", email) + console.log("-------------", username) if ( isLoading || - typeof email !== "string" + typeof username !== "string" ) { return null; } @@ -120,20 +120,12 @@ export function MixSignUp(props: { toast.success(result.header.message) props.setVerification(true); - // 自身方法 - // localStorage.setItem("data", JSON.stringify(result.data)); - // []方法 { {/* localStorage["name"]="bonly"; */ } } }).catch((err: any) => { setIsLoading(false); console.log(err); - // if (err.errors[0].code === "form_identifier_not_found") { - // props.setAccountNotFound(true); - // props.email(email); - // } else { - // props.setError("Sorry, We couldn't sign you in. Please try again later"); - // } + }); } catch (error) { setIsLoading(false); @@ -190,7 +182,6 @@ export function MixSignUp(props: { autoCapitalize="none" autoComplete="on" autoCorrect="off" - required className="h-10 text-black duration-500 bg-transparent focus:text-black border-black/20 focus:bg-white focus:border-black rounded hover:bg-white/20 hover:border-black/40 placeholder:black/20 " /> @@ -201,7 +192,6 @@ export function MixSignUp(props: { className="flex items-center justify-center h-10 gap-2 px-4 mt-8 text-sm font-semibold text-white duration-200 bg-black border border-black rounded hover:border-black/30 hover:bg-black/80 hover:text-white" disabled={isLoading} > - {/* {isLoading ? : "Sign Up with Email"} */} {t("next")} @@ -216,7 +206,9 @@ export function MixSignUp(props: { toast.error("two passwords do not match") return } + await signUpWithCode(props.emailValue, password) + setGoPassword(false) }} > @@ -229,7 +221,6 @@ export function MixSignUp(props: { name="password" placeholder={t("password")} type={showPassword ? "text" : "password"} - // defaultValue={props.passwordValue} autoCapitalize="none" autoComplete="email" autoCorrect="off" @@ -238,7 +229,6 @@ export function MixSignUp(props: { /> show { setShowPassword(!showPassword) - // toast.success('coming soon') }} /> @@ -254,7 +244,6 @@ export function MixSignUp(props: { name="confirmPassword" placeholder={t("confirm_password")} type={showPassword2 ? "text" : "password"} - // defaultValue={props.passwordValue} autoCapitalize="none" autoComplete="password" autoCorrect="off" @@ -263,7 +252,6 @@ export function MixSignUp(props: { /> show { setShowPassword2(!showPassword2) - // toast.success('coming soon') }} /> @@ -274,7 +262,6 @@ export function MixSignUp(props: { className="flex items-center justify-center h-10 gap-2 px-4 mt-8 text-sm font-semibold text-white duration-200 bg-black border border-black rounded hover:border-black/30 hover:bg-black/80 hover:text-white" disabled={isLoading} > - {/* {isLoading ? : "Sign Up with Email"} */} {isLoading ? : "Next"} diff --git a/apps/blogai/locales/en/common.json b/apps/blogai/locales/en/common.json index 409af64..ebfe448 100644 --- a/apps/blogai/locales/en/common.json +++ b/apps/blogai/locales/en/common.json @@ -7,6 +7,7 @@ "email": "Email", "regname": "User Name", "referralcode": "Referral Code", + "refcode": "Referral Code (Optional)", "mixaccount": "Phone/Email", "first_name": "First Name", "password": "Password", @@ -30,7 +31,7 @@ "verification_code": "Six-digit verification code", "send_again": "Send Again", "email_address": "Email Address", - "refcodeplaceholder": "Enter your referral code", + "refcodeplaceholder": "Enter your referral code(Optional)", "mixplacehoder": "Enter your phone number or Email address", "creat_account": "Creat Account", "frogot_password": "Frogot password?", diff --git a/apps/blogai/locales/zh-CN/common.json b/apps/blogai/locales/zh-CN/common.json index 9b2f34d..bca1077 100644 --- a/apps/blogai/locales/zh-CN/common.json +++ b/apps/blogai/locales/zh-CN/common.json @@ -7,7 +7,7 @@ "email": "邮箱", "regname": "用户名", "referralcode":"推荐码", - "refcode": "推荐码", + "refcode": "推荐码(选填)", "mixaccount": "手机号/邮箱地址", "first_name": "昵称", "password": "密码", @@ -32,7 +32,7 @@ "send_again": "再次发送", "email_address": "电子邮件地址", "mixplacehoder": "输入你的手机号或者邮箱地址", - "refcodeplaceholder": "填入你的推荐码", + "refcodeplaceholder": "填写你的推荐码(选填)", "creat_account": "创建帐户", "frogot_password": "忘记密码?", "account_not_found": "未找到帐户,您想注册吗?",