import React, {useEffect, useState} from "react"; import Popup from "@components/Popup"; import styles from "./styles.module.scss"; import usdimg from "@assets/lvicon/USD.black.png"; import {Controller, useForm} from "react-hook-form"; import PhoneInput from "@components/UInput/PhoneInput"; import classNames from "classnames"; import PasswordInput from "@components/UInput/PasswordInput"; import {validateCountryPhone} from "@utils/helpers"; import {REQ_STATUS} from "@api/config"; const i18n=global.i18n; const WBindPhone=({})=>{ const [isShow, setIsShow] = useState(false); const regCoins=5; const [country, setCountry] = useState("55"); const {register, handleSubmit, formState: {errors}, control} = useForm({ defaultValues: { phone: '', password: '', repassword:'', code:'' } }); // /bindsms {phone,code,password,repassword} const show=()=>{ setIsShow(true); } const hide=()=>{ setIsShow(false); } const validatePhone=(value)=>{ return validateCountryPhone(country,value); } const onSubmitBind=(data)=>{ } useEffect(()=>{ const bindPhone={ show, hide }; global.bindPhone=bindPhone; },[]) return (
{i18n.t("bindPhone.title_link_phone")}
{i18n.t("bindPhone.phone_award")} {regCoins}
{ onSubmitBind(data); })}> { let message = error ? i18n.t("form_errors.phone_" + country) : ""; return ( onChange(e.target.value)} onChangeCountry={(country) => { setCountry(country); }} placeholder={i18n.t('login.phone_ph')} innerRef={ref}/>) }} /> ( onChange(e.target.value)} placeholder={i18n.t('login.login_pwd')} innerRef={ref}/> )} /> ( onChange(e.target.value)} placeholder={i18n.t('login.re_pwd')} innerRef={ref}/> )} /> { return (
onChange(e.target.value)} placeholder={i18n.t('login.otp_ph')} />
) }} /> {i18n.t("bindPhone.tips")}
) } export default WBindPhone;