-
- {[slideContents[slideContents.length - 1],
- ...slideContents, slideContents[0]
- ].map((item, index) => (
-
-
-
-
{item.title}
-
{item.description}
-
-
- ))}
+
+ {steps != 0 &&
+
setSteps(steps - 1)}>
+ {`>`}
+ }
+
+
-
+
+
+ {
+ steps == 2 ?
تاییدیه ثبت نام
:
+ <>
+
+
+
+ {[slideContents[slideContents.length - 1],
+ ...slideContents, slideContents[0]
+ ].map((item, index) => (
+
+
+
+
{item.title}
+
{item.description}
+
+
+ ))}
+
+
+ {/*
{slideContents.map((_, idx) => (
))}
-
-
-
- >
-
+
*/}
+
+
+ >
+
}
-
+
{
- steps == 2 &&
- یک کد چهار رقمی تا {" "}
- دیگر برای شماره
- {" "}
-
- {signUpFields?.cellphone}
- {" "}
- ارسال خواهد شد.
-
+ steps == 2 && (resend ?
+
+ کد تایید ارسال نشد؟
+
+
+ :
+ یک کد چهار رقمی تا {" "}
+ { setResend(true) }} /> دیگر برای شماره
+ {" "}
+
+ {signUpFields?.cellphone}
+ {" "}
+ ارسال خواهد شد.
+
)
}
@@ -364,7 +374,7 @@ const LoginSignUpMobile = ({
inputMode="numeric"
style={{ direction: "ltr" }}
name="otp1"
- className="bg-red82OP rounded-md p-4 w-16 text-md text-center text-blueC0 mx-1"
+ className="bg-red82OP rounded-md p-4 w-16 text-md text-center text-blueC0 mx-1 focus:text-red52 focus:bg-white focus:outline-red52"
onChange={(e) =>
onChange(
e.target.name,
@@ -378,7 +388,7 @@ const LoginSignUpMobile = ({
inputMode="numeric"
style={{ direction: "ltr" }}
name="otp2"
- className="bg-red82OP rounded-md p-4 w-16 text-md text-center text-blueC0 mx-1"
+ className="bg-red82OP rounded-md p-4 w-16 text-md text-center text-blueC0 mx-1 focus:text-red52 focus:bg-white focus:outline-red52"
onChange={(e) =>
onChange(
e.target.name,
@@ -392,7 +402,7 @@ const LoginSignUpMobile = ({
inputMode="numeric"
style={{ direction: "ltr" }}
name="otp3"
- className="bg-red82OP rounded-md p-4 w-16 text-md text-center text-blueC0 mx-1"
+ className="bg-red82OP rounded-md p-4 w-16 text-md text-center text-blueC0 mx-1 focus:text-red52 focus:bg-white focus:outline-red52"
onChange={(e) =>
onChange(
e.target.name,
@@ -406,7 +416,7 @@ const LoginSignUpMobile = ({
inputMode="numeric"
style={{ direction: "ltr" }}
name="otp4"
- className="bg-red82OP rounded-md p-4 w-16 text-md text-center text-blueC0 mx-1"
+ className="bg-red82OP rounded-md p-4 w-16 text-md text-center text-blueC0 mx-1 focus:text-red52 focus:bg-white focus:outline-red52"
onChange={(e) =>
onChange(
e.target.name,
@@ -430,11 +440,11 @@ const LoginSignUpMobile = ({
>
تایید
-
+
شماره خود را اشتباه وارد کردید؟{" "}
-
-
-
+
+
+
@@ -470,18 +480,17 @@ const LoginSignUpMobile = ({
};
const mapStateToProps = (state) => ({
- loginFlag : state.user.status,
+ loginFlag: state.user.status,
isMobile: state.publicApi.isMobile,
- });
-
- const mapDispatchToProps = {
+});
+
+const mapDispatchToProps = {
sendOtp: user.otp_login,
sendPhoneNumber: user.otp,
setHeaderOptions: publicApi.setHeaderOptions,
- };
-
- export default connect(
+};
+
+export default connect(
mapStateToProps,
mapDispatchToProps
- )(LoginSignUpMobile);
-
\ No newline at end of file
+)(LoginSignUpMobile);
diff --git a/src/view/register/index.js b/src/view/register/index.js
index 23de6e0..d3f2a99 100644
--- a/src/view/register/index.js
+++ b/src/view/register/index.js
@@ -22,14 +22,16 @@ import Checkbox from "../../components/Checkbox";
import { ostan } from "../../constants/states";
import { cities } from "../../constants/cities";
import _onInput from "../../utils/onInput";
-import { publicApi, user } from "../../redux/actions";
+import { file, publicApi, user } from "../../redux/actions";
import { VscDebugBreakpointUnsupported } from "react-icons/vsc";
+import axios from "axios";
+import { ApiConfig } from "../../constants/defaultValues";
+import { toast } from "react-toastify";
const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, province, city, user }) => {
const [steps, setSteps] = useState(0);
- const [index, setIndex] = useState(1);
- const [register, setRegister] = useState(false);
+
const timeoutRef = useRef(null);
const [activeStep, setActiveStep] = useState([true, false, false, false]);
const [error, setError] = useState('');
@@ -37,26 +39,29 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro
getProvince();
getCity();
}, [])
+
+
useEffect(() => {
- if(user?.firstName !== null){
- setUserInfo({...userInfo,
- firstName: user.firstName,
- lastName: user.lastName,
- nationalId: user.nationalId,
- // birthDate: user.birthDate.toLocaleDateString('fa-IR'),
- gender: user.gender,
- previousSchoolName: user.previousSchoolName,
- previousSchoolType: user.previousSchoolType,
- zone:user.zone,
- familyMemberCount: user.familyMemberCount,
- phone: user.phone,
- address: user.address
-
- })
+ if (user?.firstName !== null) {
+ setUserInfo({
+ ...userInfo,
+ firstName: user.firstName,
+ lastName: user.lastName,
+ nationalId: user.nationalId,
+ // birthDate: user.birthDate.toLocaleDateString('fa-IR'),
+ gender: user.gender,
+ previousSchoolName: user.previousSchoolName,
+ previousSchoolType: user.previousSchoolType,
+ zone: user.zone,
+ familyMemberCount: user.familyMemberCount,
+ phone: user.phone,
+ address: user.address
+
+ })
}
}, [user])
useEffect(() => {
- window.scrollTo(0,0);
+ window.scrollTo(0, 0);
}, [steps])
const madraks = [
@@ -106,6 +111,10 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro
},
]
+ const [files, setFiles] = useState({
+ shenasNameh: null,
+ personalPic: null
+ })
const [userInfo, setUserInfo] = useState({
firstName: null,
@@ -144,7 +153,7 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro
address: null,
phone: null,
rulesAccepted: false,
-
+
});
@@ -195,7 +204,7 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro
},
{
title: 'مدرک تحصیلی',
- value:madraks.find(itm => itm.id == userInfo.fatherInfo.education)?.title
+ value: madraks.find(itm => itm.id == userInfo.fatherInfo.education)?.title
},
{
title: 'تلفن همراه',
@@ -383,9 +392,10 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro
)
}
-
+
const [selectedState, setSelectedState] = useState(null);
const [selectedCity, setSelectedCity] = useState(null);
+
return (
isMobile ?
:
@@ -435,7 +445,7 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro
-
+
{/* Content */}
@@ -451,48 +461,48 @@ const Register = ({ activeLogin, isMobile, setProfile, getProvince, getCity, pro