"use client"; import AppContext from "@ctx/AppContext"; import { useLocale, useTranslations } from "next-intl"; import Buttonbriz from "plugins/Buttonbriz/page"; import Input from "plugins/Input/page"; import validateIranPhone from "plugins/IranPhoneRegex"; import React, { useContext, useState } from "react"; import { toast } from "react-toastify"; const LoginStep = (props) => { const [roleCheckBox, setRoleCheckBox] = useState(false); const [alertRolCheckBox, setAlertRolCheckBox] = useState(false); const CTX = useContext(AppContext); const phoneNumber = CTX.state.phoneNumber; const t = useTranslations("login"); const locale = useLocale(); const isRTL = locale === "fa"; const handleConfirmPhoneNumber = () => { setAlertRolCheckBox(false); if (validateIranPhone(phoneNumber) && roleCheckBox) { CTX.ConfirmPhoneNumber(phoneNumber); } else { if (!validateIranPhone(phoneNumber)) { toast.error(" شماره تماس را درست وارد کنید ", { position: "bottom-right", closeOnClick: true, }); } else if (!roleCheckBox) { toast.error(`برای ورود تایید قوانین الزامی است`, { position: "bottom-right", closeOnClick: true, }); setTimeout(() => { setAlertRolCheckBox(true); }, 100); } } }; return (
{" "} برای ورود یا ثبت نام باید شماره تلفن همراه خود را وارد کنید
*/}{t("acceptRule")}