|
@@ -1,85 +1,111 @@
|
|
|
"use client";
|
|
|
-import { ChangeEvent, FC, PropsWithChildren, useState } from "react";
|
|
|
import ButtonOwn from "@/components/ButtonOwn";
|
|
|
-import Link from "next/link";
|
|
|
-import './page.scss'
|
|
|
-import { ActionSheet } from 'antd-mobile'
|
|
|
-import type { Action } from 'antd-mobile/es/components/action-sheet'
|
|
|
+import { ActionSheet } from "antd-mobile";
|
|
|
+import type { Action } from "antd-mobile/es/components/action-sheet";
|
|
|
import { useTranslations } from "next-intl";
|
|
|
+import Link from "next/link";
|
|
|
+import { ChangeEvent, FC, useState } from "react";
|
|
|
+import "./page.scss";
|
|
|
|
|
|
interface Props {}
|
|
|
|
|
|
-const Withdraw: FC<PropsWithChildren<Props>> = () => {
|
|
|
+const Withdraw: FC<Props> = () => {
|
|
|
const t = useTranslations("WithdrawPage");
|
|
|
|
|
|
const actions: Action[] = [
|
|
|
- { text: 'CPF', key: 'CPF' },
|
|
|
- { text: t('Número'), key: 'Celular' },
|
|
|
- { text: 'EMAIL', key: 'EMAIL' },
|
|
|
- ]
|
|
|
- let amount = 50
|
|
|
+ { text: "CPF", key: "CPF" },
|
|
|
+ { text: t("Número"), key: "Celular" },
|
|
|
+ { text: "EMAIL", key: "EMAIL" },
|
|
|
+ ];
|
|
|
+ let amount = 50;
|
|
|
let [account, setAccount] = useState({
|
|
|
- secretKey: '',
|
|
|
- money:''
|
|
|
- })
|
|
|
+ secretKey: "",
|
|
|
+ money: "",
|
|
|
+ });
|
|
|
const setInputVal = (e: ChangeEvent<HTMLInputElement>) => {
|
|
|
- const {name, value} = e.target;
|
|
|
+ const { name, value } = e.target;
|
|
|
setAccount({
|
|
|
...account,
|
|
|
- [name]: value
|
|
|
- })
|
|
|
- }
|
|
|
+ [name]: value,
|
|
|
+ });
|
|
|
+ };
|
|
|
|
|
|
- let [visible, setVisible] = useState(false)
|
|
|
- let [prefix, setPrefix] = useState('CPF')
|
|
|
- let [placeholder, setPlaceholder] = useState('000.000.000-00')
|
|
|
+ let [visible, setVisible] = useState(false);
|
|
|
+ let [prefix, setPrefix] = useState("CPF");
|
|
|
+ let [placeholder, setPlaceholder] = useState("000.000.000-00");
|
|
|
const onAction = (action: any) => {
|
|
|
- setPrefix(action.text as any)
|
|
|
- if(action.key == 'CPF') {
|
|
|
- setPlaceholder('000.000.000-00')
|
|
|
- return
|
|
|
+ setPrefix(action.text as any);
|
|
|
+ if (action.key == "CPF") {
|
|
|
+ setPlaceholder("000.000.000-00");
|
|
|
+ return;
|
|
|
}
|
|
|
- if(action.key == 'Celular') {
|
|
|
- setPlaceholder('11 dígitos')
|
|
|
- return
|
|
|
+ if (action.key == "Celular") {
|
|
|
+ setPlaceholder("11 dígitos");
|
|
|
+ return;
|
|
|
}
|
|
|
- if(action.key == 'EMAIL') {
|
|
|
- setPlaceholder('EMAIL')
|
|
|
- return
|
|
|
+ if (action.key == "EMAIL") {
|
|
|
+ setPlaceholder("EMAIL");
|
|
|
+ return;
|
|
|
}
|
|
|
- }
|
|
|
+ };
|
|
|
|
|
|
return (
|
|
|
<div className="withdraw-box">
|
|
|
<div className="img-box"></div>
|
|
|
- <p className="btn-box" color="primary">PIX V</p>
|
|
|
- <h1>{t('Certifique')}</h1>
|
|
|
+ <p className="btn-box" color="primary">
|
|
|
+ PIX V
|
|
|
+ </p>
|
|
|
+ <h1>{t("Certifique")}</h1>
|
|
|
<div className="amount-box">
|
|
|
- <span>{t('Tipo')}</span>
|
|
|
+ <span>{t("Tipo")}</span>
|
|
|
<div className="input-box">
|
|
|
- <label onClick={() => setVisible(true)}>{prefix} <span className="iconfont icon-xialaxuanze"></span></label>
|
|
|
- <input name="secretKey" type="number" value={account.secretKey} onChange={setInputVal} placeholder={placeholder} />
|
|
|
+ <label onClick={() => setVisible(true)}>
|
|
|
+ {prefix} <span className="iconfont icon-xialaxuanze"></span>
|
|
|
+ </label>
|
|
|
+ <input
|
|
|
+ name="secretKey"
|
|
|
+ type="number"
|
|
|
+ value={account.secretKey}
|
|
|
+ onChange={setInputVal}
|
|
|
+ placeholder={placeholder}
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
- <h1>{t('Vincule')}</h1>
|
|
|
+ <h1>{t("Vincule")}</h1>
|
|
|
<div className="amount-box">
|
|
|
- <span>{t('Montante')} (BRL):</span>
|
|
|
+ <span>{t("Montante")} (BRL):</span>
|
|
|
<div className="input-box">
|
|
|
- <input name="money" type="number" value={account.money} onChange={setInputVal} placeholder="Mín. 10.00"/>
|
|
|
+ <input
|
|
|
+ name="money"
|
|
|
+ type="number"
|
|
|
+ value={account.money}
|
|
|
+ onChange={setInputVal}
|
|
|
+ placeholder="Mín. 10.00"
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
<ul className="ul-box">
|
|
|
- <li>{t('SaqueDisponivel')} <span className="tip">0 BRL</span></li>
|
|
|
- <li>{t('Valor')} <span className="tip">0 BRL</span> <span className="iconfont icon-iconhelp"></span></li>
|
|
|
- <li>{t('Para')}, <Link href="/" className="toHome router-link-active" replace>{t('Aposte')}</Link></li>
|
|
|
+ <li>
|
|
|
+ {t("SaqueDisponivel")} <span className="tip">0 BRL</span>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ {t("Valor")} <span className="tip">0 BRL</span>{" "}
|
|
|
+ <span className="iconfont icon-iconhelp"></span>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ {t("Para")},{" "}
|
|
|
+ <Link href="/" className="toHome router-link-active" replace>
|
|
|
+ {t("Aposte")}
|
|
|
+ </Link>
|
|
|
+ </li>
|
|
|
</ul>
|
|
|
<div className="topUp">
|
|
|
- <ButtonOwn active={amount>0?true:false}>{t('Saque')}</ButtonOwn>
|
|
|
+ <ButtonOwn active={amount > 0 ? true : false}>{t("Saque")}</ButtonOwn>
|
|
|
</div>
|
|
|
|
|
|
<ActionSheet
|
|
|
- extra=''
|
|
|
- cancelText={t('Cancelar')}
|
|
|
+ extra=""
|
|
|
+ cancelText={t("Cancelar")}
|
|
|
visible={visible}
|
|
|
actions={actions}
|
|
|
closeOnAction={true}
|