|
@@ -4,6 +4,7 @@ import clsx from "clsx";
|
|
|
import Link from "next/link";
|
|
|
import ButtonOwn from "@/components/ButtonOwn";
|
|
|
import "./style.scss";
|
|
|
+import { useTranslations } from "next-intl";
|
|
|
|
|
|
/**
|
|
|
* @description 登录注册From表单
|
|
@@ -18,6 +19,7 @@ export interface FromComProps {
|
|
|
}
|
|
|
|
|
|
const FromCom: FC<PropsWithChildren<FromComProps>> = ({type = 'login', msgError = '', callbackFun}) => {
|
|
|
+ const t = useTranslations("LoginPage");
|
|
|
let [pwdVisible, setPwdVisible] = useState(false)
|
|
|
const spanClassName = clsx("iconfont", {
|
|
|
"icon-kejian": pwdVisible,
|
|
@@ -59,25 +61,25 @@ const FromCom: FC<PropsWithChildren<FromComProps>> = ({type = 'login', msgError
|
|
|
return (
|
|
|
<div className="FromCom">
|
|
|
<div className="phoneInput">
|
|
|
- <span className="after">+55</span>
|
|
|
- <input name="userPhone" type="tel" value={fromParam.userPhone} onChange={setInputVal} placeholder="Número de Celular" maxLength={11} />
|
|
|
+ <span className="after">{t("areaCode")}</span>
|
|
|
+ <input name="userPhone" type="tel" value={fromParam.userPhone} onChange={setInputVal} placeholder={t("Celular")} maxLength={11} />
|
|
|
</div>
|
|
|
<div className="passwordInput">
|
|
|
- <input name="pwd" type={pwdVisible?'text':'password'} value={fromParam.pwd} onChange={setInputVal} onInput={verifyPwd} placeholder="Senha" maxLength={12}/>
|
|
|
+ <input name="pwd" type={pwdVisible?'text':'password'} value={fromParam.pwd} onChange={setInputVal} onInput={verifyPwd} placeholder={t("Senha")} maxLength={12}/>
|
|
|
<span className={spanClassName} onClick={() => setPwdVisible(!pwdVisible)}></span>
|
|
|
</div>
|
|
|
<div className="btnContent">
|
|
|
{ msgError && <div className="tips"> {msgError} </div> }
|
|
|
- <ButtonOwn active={activeCls} callbackFun={submitRequest}>{type == 'login'? 'Login' : 'Criar conta'}</ButtonOwn>
|
|
|
+ <ButtonOwn active={activeCls} callbackFun={submitRequest}>{type == 'login'? 'Login' : t("register")}</ButtonOwn>
|
|
|
</div>
|
|
|
<div className="link">
|
|
|
{
|
|
|
type == 'login' ? (
|
|
|
<>
|
|
|
- <Link href="/br/resetPhone">Esqueci minha senha?</Link>
|
|
|
- <Link href="/br/register">Criar Conta Nova</Link>
|
|
|
+ <Link href="/br/resetPhone">{t("forgetPwd")}</Link>
|
|
|
+ <Link href="/br/register">{t("registerGo")}</Link>
|
|
|
</>
|
|
|
- ) : <Link href="/br/login" className="active" replace>Já tem uma conta? Log in</Link>
|
|
|
+ ) : <Link href="/br/login" className="active" replace>{t("loginGo")}</Link>
|
|
|
}
|
|
|
</div>
|
|
|
</div>
|