import React, { Component } from "react"; import onInput from "~/util/onInput"; import { user } from "~/Redux/actions"; import { connect } from "react-redux"; import Select from "./Select/index"; import Input from "./Input/index"; import TextArea from "./TextArea/index"; import Upload from "./Upload/index"; import Gender from "./GenderSwitch/index"; import Birthdate from "./Birthdate/index"; import MultipleSelector from "./MultipleSelector/index"; import Loader from "~/components/Loader/index"; import Document from "./Document/index"; import logo from "../../../assets/icons/logo.png"; import pic from "../../../assets/images/pic.png"; import "./index.scss"; const maxDesktopSize = 1250; const maxMobileSize = 550; const fontSize = { desktop: { h1: window.innerWidth > maxDesktopSize ? 25 : window.innerWidth / 55, p: window.innerWidth > maxDesktopSize ? 14 : window.innerWidth / 90, }, mobile: { h1: window.innerWidth > maxMobileSize ? 20 : window.innerWidth / 18, p: window.innerWidth > maxMobileSize ? 14 : window.innerWidth / 28, }, }; const toastMessages = { firstName: "نام وارد شده صحیح نیست!", lastName: "نام خانوادگی وارد شده صحیح نیست!", username: "نام کاربری صحیح نیست.", }; class Profile extends Component { state = { render: false, file: null, docFileIds: "", firstName: "", lastName: "", password: "", username: "", address: "", email: "", gender: "دختر", userRoleId: "دانش آموز", nationalId: "", provinceId: "", phone: "", cityId: "", zoneId: "", schoolId: "", postalCode: "", gradeId: [], validation: { firstName: "", lastName: "", username: "", email: "", postalCode: "", nationalId: "", schoolId: "", }, }; componentDidMount() { // this.props.getProfile(); } onChange = (name, value) => { if (name === "gardeId" && this.state.userRoleId === "معلم") { this.setState((prevState) => ({ gradeId: [...prevState.gradeId, value], })); } if (name === "userRoleId") { this.setState({ gradeId: [], [name]: value, }); } else { this.setState({ [name]: value, }); } }; onSubmit = async (e) => { const { firstName, lastName, username, cellphone, password, postalCode, address, email, phone, } = this.state; const { profile, setProfile } = this.props; const data = { firstName: firstName || profile.firstName, lastName: lastName || profile.lastName, username: username || profile.username, cellphone: profile.cellphone, password: password || profile.password, postalCode: postalCode || profile.postalCode, address: address || profile.address, email: email || profile.email, phone: phone || profile.phone, }; await setProfile(data); }; render() { const grades = [ "پیش دبستان", "اول", "دوم", "سوم", "چهارم", "پنجم", "ششم", "هفتم", "هشتم", "نهم", "دهم", "یازدهم", "دوازدهم", ]; const { user, profile } = this.props; return ( <> {window.innerWidth > 1000 ? ( profile ? (
لطفا مشخصات خود را به صورت کامل نمایید.
لطفا مشحصات خود را به صورت کامل وارد نمایید