|
|
|
@ -9,6 +9,7 @@ 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 logo from "../../../assets/icons/logo.png"; |
|
|
|
|
import pic from "../../../assets/images/pic.png"; |
|
|
|
@ -30,6 +31,7 @@ const fontSize = { |
|
|
|
|
}; |
|
|
|
|
class Profile extends Component { |
|
|
|
|
state = { |
|
|
|
|
render: false, |
|
|
|
|
file: null, |
|
|
|
|
firstName: "", |
|
|
|
|
lastName: "", |
|
|
|
@ -66,9 +68,17 @@ class Profile extends Component { |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
componentDidMount() { |
|
|
|
|
async componentDidMount() { |
|
|
|
|
const { getProfile, profile } = this.props; |
|
|
|
|
// getProfile();
|
|
|
|
|
getProfile(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
componentDidUpdate(prevProps) { |
|
|
|
|
if (prevProps.profile !== this.props.profile) { |
|
|
|
|
this.setState({ |
|
|
|
|
render: true, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
onSubmit = async (e) => { |
|
|
|
@ -103,340 +113,366 @@ class Profile extends Component { |
|
|
|
|
return ( |
|
|
|
|
<> |
|
|
|
|
{window.innerWidth > 1000 ? ( |
|
|
|
|
<div className="auth-profile d-flex justify-content-center"> |
|
|
|
|
<div className="auth-profile__box d-flex flex-column p-4"> |
|
|
|
|
<h1 style={{ fontSize: fontSize.desktop.h1 }}>حساب کاربری</h1> |
|
|
|
|
<p style={{ fontSize: fontSize.desktop.p }}> |
|
|
|
|
لطفا مشخصات خود را به صورت کامل نمایید. |
|
|
|
|
</p> |
|
|
|
|
<form |
|
|
|
|
className="auth-profile__box--form d-flex" |
|
|
|
|
onSubmit={(e) => this.onSubmit(e)} |
|
|
|
|
> |
|
|
|
|
<div style={{ width: "48%" }}> |
|
|
|
|
<div className="mb-2 d-flex justify-content-center"> |
|
|
|
|
<Upload name="file" parent={this} /> |
|
|
|
|
</div> |
|
|
|
|
<div className="mb-2"> |
|
|
|
|
<Input |
|
|
|
|
name="firstName" |
|
|
|
|
label="نام" |
|
|
|
|
parent={this} |
|
|
|
|
defaultValue={profile.firstName} |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
<div className="mb-2"> |
|
|
|
|
<Input |
|
|
|
|
name="lastName" |
|
|
|
|
label="نام خانوادگی" |
|
|
|
|
parent={this} |
|
|
|
|
defaultValue={profile.lastName} |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
<div className="mb-2"> |
|
|
|
|
<Input |
|
|
|
|
name="username" |
|
|
|
|
label="نام کاربری" |
|
|
|
|
parent={this} |
|
|
|
|
defaultValue={profile.username} |
|
|
|
|
align="left" |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
!this.props.loading ? ( |
|
|
|
|
<div className="auth-profile d-flex justify-content-center"> |
|
|
|
|
<div className="auth-profile__box d-flex flex-column p-4"> |
|
|
|
|
<h1 style={{ fontSize: fontSize.desktop.h1 }}>حساب کاربری</h1> |
|
|
|
|
<p style={{ fontSize: fontSize.desktop.p }}> |
|
|
|
|
لطفا مشخصات خود را به صورت کامل نمایید. |
|
|
|
|
</p> |
|
|
|
|
<form |
|
|
|
|
className="auth-profile__box--form d-flex" |
|
|
|
|
onSubmit={(e) => this.onSubmit(e)} |
|
|
|
|
> |
|
|
|
|
<div style={{ width: "48%" }}> |
|
|
|
|
<div className="mb-2 d-flex justify-content-center"> |
|
|
|
|
<Upload name="file" parent={this} /> |
|
|
|
|
</div> |
|
|
|
|
<div className="mb-2"> |
|
|
|
|
<Input |
|
|
|
|
name="firstName" |
|
|
|
|
label="نام" |
|
|
|
|
parent={this} |
|
|
|
|
defaultValue={profile.firstName} |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
<div className="mb-2"> |
|
|
|
|
<Input |
|
|
|
|
name="lastName" |
|
|
|
|
label="نام خانوادگی" |
|
|
|
|
parent={this} |
|
|
|
|
defaultValue={profile.lastName} |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
<div className="mb-2"> |
|
|
|
|
<Input |
|
|
|
|
name="username" |
|
|
|
|
label="نام کاربری" |
|
|
|
|
parent={this} |
|
|
|
|
defaultValue={profile.username} |
|
|
|
|
align="left" |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div className="mb-2"> |
|
|
|
|
<Gender |
|
|
|
|
options={["دختر", "پسر"]} |
|
|
|
|
parent={this} |
|
|
|
|
name="gender" |
|
|
|
|
selectedOption={this.state.gender} |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
<div className="mb-2"> |
|
|
|
|
<Input |
|
|
|
|
name="nationalId" |
|
|
|
|
label="کد ملی" |
|
|
|
|
parent={this} |
|
|
|
|
align="left" |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
<div className="mb-2"> |
|
|
|
|
<Birthdate /> |
|
|
|
|
</div> |
|
|
|
|
{/* <div className="mb-2"> |
|
|
|
|
<div className="mb-2"> |
|
|
|
|
<Gender |
|
|
|
|
options={["دختر", "پسر"]} |
|
|
|
|
parent={this} |
|
|
|
|
name="gender" |
|
|
|
|
selectedOption={this.state.gender} |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
<div className="mb-2"> |
|
|
|
|
<Input |
|
|
|
|
name="nationalId" |
|
|
|
|
label="کد ملی" |
|
|
|
|
parent={this} |
|
|
|
|
align="left" |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
<div className="mb-2"> |
|
|
|
|
<Birthdate /> |
|
|
|
|
</div> |
|
|
|
|
{/* <div className="mb-2"> |
|
|
|
|
<Input name="password" label="رمز عبور" parent={this} /> |
|
|
|
|
</div> */} |
|
|
|
|
</div> |
|
|
|
|
<div style={{ width: "48%" }}> |
|
|
|
|
<div className="mb-2" style={{ minWidth: "100%" }}> |
|
|
|
|
<Gender |
|
|
|
|
parent={this} |
|
|
|
|
options={["معلم", "دانش آموز"]} |
|
|
|
|
name="userRoleId" |
|
|
|
|
label={"عنوان"} |
|
|
|
|
selectedOption={this.state.userRoleId} |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
{this.state.userRoleId === "دانش آموز" ? ( |
|
|
|
|
<div className="mb-2"> |
|
|
|
|
<div style={{ width: "48%" }}> |
|
|
|
|
<div className="mb-2" style={{ minWidth: "100%" }}> |
|
|
|
|
<Gender |
|
|
|
|
parent={this} |
|
|
|
|
options={["معلم", "دانش آموز"]} |
|
|
|
|
name="userRoleId" |
|
|
|
|
label={"عنوان"} |
|
|
|
|
selectedOption={this.state.userRoleId} |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
{this.state.userRoleId === "دانش آموز" ? ( |
|
|
|
|
<div className="mb-2"> |
|
|
|
|
<Select |
|
|
|
|
parent={this} |
|
|
|
|
options={[ |
|
|
|
|
"1", |
|
|
|
|
"2", |
|
|
|
|
"3", |
|
|
|
|
"4", |
|
|
|
|
"5", |
|
|
|
|
"6", |
|
|
|
|
"7", |
|
|
|
|
"8", |
|
|
|
|
"9", |
|
|
|
|
"10", |
|
|
|
|
"11", |
|
|
|
|
"12", |
|
|
|
|
]} |
|
|
|
|
name="gradeId" |
|
|
|
|
label={"پایه تحصیلی"} |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
) : null} |
|
|
|
|
{this.state.userRoleId === "معلم" ? ( |
|
|
|
|
<div className="mb-2"> |
|
|
|
|
<MultipleSelector |
|
|
|
|
parent={this} |
|
|
|
|
options={[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]} |
|
|
|
|
name="gradeId" |
|
|
|
|
label={"پایه تحصیلی"} |
|
|
|
|
selectedOptions={this.state.gradeId} |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
) : null} |
|
|
|
|
|
|
|
|
|
{this.state.userRoleId === "دانش آموز" && |
|
|
|
|
this.state.gradeId > 9 ? ( |
|
|
|
|
<div className="mb-2"> |
|
|
|
|
<Select |
|
|
|
|
parent={this} |
|
|
|
|
options={[ |
|
|
|
|
"ریاضی", |
|
|
|
|
"تجربی", |
|
|
|
|
"انسانی", |
|
|
|
|
"فنی حرفهای", |
|
|
|
|
"کاردانش", |
|
|
|
|
"معارف", |
|
|
|
|
]} |
|
|
|
|
name="field" |
|
|
|
|
label={"رشته تحصیلی"} |
|
|
|
|
selectedOptions={this.state.gradeId} |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
) : null} |
|
|
|
|
|
|
|
|
|
<div className="mb-2" style={{ minWidth: "100%" }}> |
|
|
|
|
<Select |
|
|
|
|
parent={this} |
|
|
|
|
options={[ |
|
|
|
|
"1", |
|
|
|
|
"2", |
|
|
|
|
"3", |
|
|
|
|
"4", |
|
|
|
|
"5", |
|
|
|
|
"6", |
|
|
|
|
"7", |
|
|
|
|
"8", |
|
|
|
|
"9", |
|
|
|
|
"10", |
|
|
|
|
"11", |
|
|
|
|
"12", |
|
|
|
|
]} |
|
|
|
|
name="gradeId" |
|
|
|
|
label={"پایه تحصیلی"} |
|
|
|
|
options={["karaj", "tehran"]} |
|
|
|
|
name="province" |
|
|
|
|
label={"استان"} |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
) : null} |
|
|
|
|
{this.state.userRoleId === "معلم" ? ( |
|
|
|
|
<div className="mb-2"> |
|
|
|
|
<MultipleSelector |
|
|
|
|
<Select |
|
|
|
|
parent={this} |
|
|
|
|
options={[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]} |
|
|
|
|
name="gradeId" |
|
|
|
|
label={"پایه تحصیلی"} |
|
|
|
|
selectedOptions={this.state.gradeId} |
|
|
|
|
options={["karaj", "tehran"]} |
|
|
|
|
name="city" |
|
|
|
|
label={"شهرستان"} |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
) : null} |
|
|
|
|
|
|
|
|
|
{this.state.userRoleId === "دانش آموز" && |
|
|
|
|
this.state.gradeId > 9 ? ( |
|
|
|
|
<div className="mb-2"> |
|
|
|
|
<Select |
|
|
|
|
parent={this} |
|
|
|
|
options={[ |
|
|
|
|
"ریاضی", |
|
|
|
|
"تجربی", |
|
|
|
|
"انسانی", |
|
|
|
|
"فنی حرفهای", |
|
|
|
|
"کاردانش", |
|
|
|
|
"معارف", |
|
|
|
|
]} |
|
|
|
|
name="field" |
|
|
|
|
label={"رشته تحصیلی"} |
|
|
|
|
selectedOptions={this.state.gradeId} |
|
|
|
|
options={["chaharbagh", "mahalat"]} |
|
|
|
|
name="zoneId" |
|
|
|
|
label={"شهر/روستا"} |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
) : null} |
|
|
|
|
|
|
|
|
|
<div className="mb-2" style={{ minWidth: "100%" }}> |
|
|
|
|
<Select |
|
|
|
|
parent={this} |
|
|
|
|
options={["karaj", "tehran"]} |
|
|
|
|
name="province" |
|
|
|
|
label={"استان"} |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
<div className="mb-2"> |
|
|
|
|
<Select |
|
|
|
|
parent={this} |
|
|
|
|
options={["karaj", "tehran"]} |
|
|
|
|
name="city" |
|
|
|
|
label={"شهرستان"} |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
<div className="mb-2"> |
|
|
|
|
<Select |
|
|
|
|
parent={this} |
|
|
|
|
options={["chaharbagh", "mahalat"]} |
|
|
|
|
name="zoneId" |
|
|
|
|
label={"شهر/روستا"} |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
{this.state.userRoleId === "دانش آموز" ? ( |
|
|
|
|
{this.state.userRoleId === "دانش آموز" ? ( |
|
|
|
|
<div className="mb-2"> |
|
|
|
|
<Input |
|
|
|
|
parent={this} |
|
|
|
|
name="schoolId" |
|
|
|
|
label={"نام مدرسه"} |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
) : null} |
|
|
|
|
{this.state.userRoleId === "معلم" ? ( |
|
|
|
|
<div className="mb-2"> |
|
|
|
|
<Input |
|
|
|
|
parent={this} |
|
|
|
|
name="schoolId" |
|
|
|
|
label={"محل تدریس"} |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
) : null} |
|
|
|
|
<div className="mb-2"> |
|
|
|
|
<Input |
|
|
|
|
parent={this} |
|
|
|
|
name="schoolId" |
|
|
|
|
label={"نام مدرسه"} |
|
|
|
|
name="postalCode" |
|
|
|
|
label={"کد پستی"} |
|
|
|
|
align="left" |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
) : null} |
|
|
|
|
{this.state.userRoleId === "معلم" ? ( |
|
|
|
|
<div className="mb-2"> |
|
|
|
|
<Input |
|
|
|
|
<TextArea |
|
|
|
|
parent={this} |
|
|
|
|
name="schoolId" |
|
|
|
|
label={"محل تدریس"} |
|
|
|
|
label={"آدرس محل سکونت"} |
|
|
|
|
name="address" |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
) : null} |
|
|
|
|
<div className="mb-2"> |
|
|
|
|
<Input |
|
|
|
|
parent={this} |
|
|
|
|
name="postalCode" |
|
|
|
|
label={"کد پستی"} |
|
|
|
|
align="left" |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
<div className="mb-2"> |
|
|
|
|
<TextArea |
|
|
|
|
parent={this} |
|
|
|
|
label={"آدرس محل سکونت"} |
|
|
|
|
name="address" |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
<div className="auth-profile__box--form__footer d-flex justify-content-center"> |
|
|
|
|
<button>ذخیره</button> |
|
|
|
|
<div className="auth-profile__box--form__footer d-flex justify-content-center"> |
|
|
|
|
<button>ذخیره</button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</form> |
|
|
|
|
</form> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
) : ( |
|
|
|
|
<Loader /> |
|
|
|
|
) |
|
|
|
|
) : null} |
|
|
|
|
{window.innerWidth < 1000 ? ( |
|
|
|
|
<div className="mobile-auth-profile d-flex flex-column"> |
|
|
|
|
<img src={logo} alt="دانوین" /> |
|
|
|
|
<h1 style={{ fontSize: fontSize.mobile.h1 }}>حساب کاربری</h1> |
|
|
|
|
<p style={{ fontSize: fontSize.mobile.p }}> |
|
|
|
|
لطفا مشحصات خود را به صورت کامل وارد نمایید |
|
|
|
|
</p> |
|
|
|
|
<Upload name="file" parent={this} /> |
|
|
|
|
<Input |
|
|
|
|
name="firstName" |
|
|
|
|
label="نام" |
|
|
|
|
parent={this} |
|
|
|
|
defaultValue={profile.firstName} |
|
|
|
|
/> |
|
|
|
|
<Input |
|
|
|
|
name="lastName" |
|
|
|
|
label="نام خانوادگی" |
|
|
|
|
parent={this} |
|
|
|
|
defaultValue={profile.lastName} |
|
|
|
|
/> |
|
|
|
|
<Input |
|
|
|
|
name="username" |
|
|
|
|
label="نام کاربری" |
|
|
|
|
parent={this} |
|
|
|
|
align="left" |
|
|
|
|
/> |
|
|
|
|
<Gender |
|
|
|
|
options={["دختر", "پسر"]} |
|
|
|
|
parent={this} |
|
|
|
|
name="gender" |
|
|
|
|
selectedOption={this.state.gender} |
|
|
|
|
/> |
|
|
|
|
<Input |
|
|
|
|
name="nationalId" |
|
|
|
|
label="کد ملی" |
|
|
|
|
parent={this} |
|
|
|
|
align="left" |
|
|
|
|
/> |
|
|
|
|
<Birthdate /> |
|
|
|
|
<Gender |
|
|
|
|
parent={this} |
|
|
|
|
options={["معلم", "دانش آموز"]} |
|
|
|
|
name="userRoleId" |
|
|
|
|
selectedOption={this.state.userRoleId} |
|
|
|
|
/> |
|
|
|
|
{this.state.userRoleId === "دانش آموز" ? ( |
|
|
|
|
!this.props.loading ? ( |
|
|
|
|
<div className="mobile-auth-profile d-flex flex-column"> |
|
|
|
|
<img src={logo} alt="دانوین" /> |
|
|
|
|
<h1 style={{ fontSize: fontSize.mobile.h1 }}>حساب کاربری</h1> |
|
|
|
|
<p style={{ fontSize: fontSize.mobile.p }}> |
|
|
|
|
لطفا مشحصات خود را به صورت کامل وارد نمایید |
|
|
|
|
</p> |
|
|
|
|
<Upload name="file" parent={this} /> |
|
|
|
|
<Input |
|
|
|
|
name="firstName" |
|
|
|
|
label="نام" |
|
|
|
|
parent={this} |
|
|
|
|
defaultValue={profile} |
|
|
|
|
/> |
|
|
|
|
<Input |
|
|
|
|
name="lastName" |
|
|
|
|
label="نام خانوادگی" |
|
|
|
|
parent={this} |
|
|
|
|
defaultValue={profile} |
|
|
|
|
/> |
|
|
|
|
<Input |
|
|
|
|
name="username" |
|
|
|
|
label="نام کاربری" |
|
|
|
|
parent={this} |
|
|
|
|
align="left" |
|
|
|
|
defaultValue={profile} |
|
|
|
|
/> |
|
|
|
|
<Gender |
|
|
|
|
options={["دختر", "پسر"]} |
|
|
|
|
parent={this} |
|
|
|
|
name="gender" |
|
|
|
|
selectedOption={this.state.gender} |
|
|
|
|
/> |
|
|
|
|
<Input |
|
|
|
|
name="nationalId" |
|
|
|
|
label="کد ملی" |
|
|
|
|
parent={this} |
|
|
|
|
align="left" |
|
|
|
|
defaultValue={profile} |
|
|
|
|
/> |
|
|
|
|
<Birthdate /> |
|
|
|
|
<Gender |
|
|
|
|
parent={this} |
|
|
|
|
options={["معلم", "دانش آموز"]} |
|
|
|
|
name="userRoleId" |
|
|
|
|
selectedOption={this.state.userRoleId} |
|
|
|
|
/> |
|
|
|
|
{this.state.userRoleId === "دانش آموز" ? ( |
|
|
|
|
<Select |
|
|
|
|
parent={this} |
|
|
|
|
options={[ |
|
|
|
|
"1", |
|
|
|
|
"2", |
|
|
|
|
"3", |
|
|
|
|
"4", |
|
|
|
|
"5", |
|
|
|
|
"6", |
|
|
|
|
"7", |
|
|
|
|
"8", |
|
|
|
|
"9", |
|
|
|
|
"10", |
|
|
|
|
"11", |
|
|
|
|
"12", |
|
|
|
|
]} |
|
|
|
|
name="gradeId" |
|
|
|
|
label={"پایه تحصیلی"} |
|
|
|
|
/> |
|
|
|
|
) : null} |
|
|
|
|
{this.state.userRoleId === "معلم" ? ( |
|
|
|
|
<MultipleSelector |
|
|
|
|
parent={this} |
|
|
|
|
options={[ |
|
|
|
|
"1", |
|
|
|
|
"2", |
|
|
|
|
"3", |
|
|
|
|
"4", |
|
|
|
|
"5", |
|
|
|
|
"6", |
|
|
|
|
"7", |
|
|
|
|
"8", |
|
|
|
|
"9", |
|
|
|
|
"10", |
|
|
|
|
"11", |
|
|
|
|
"12", |
|
|
|
|
]} |
|
|
|
|
name="gradeId" |
|
|
|
|
label={"پایه تحصیلی"} |
|
|
|
|
selectedOptions={this.state.gradeId} |
|
|
|
|
/> |
|
|
|
|
) : null} |
|
|
|
|
{this.state.userRoleId === "دانش آموز" && |
|
|
|
|
this.state.gradeId.length > 0 ? ( |
|
|
|
|
<Select |
|
|
|
|
parent={this} |
|
|
|
|
options={[ |
|
|
|
|
"ریاضی", |
|
|
|
|
"تجربی", |
|
|
|
|
"انسانی", |
|
|
|
|
"فنی حرفهای", |
|
|
|
|
"کاردانش", |
|
|
|
|
"معارف", |
|
|
|
|
]} |
|
|
|
|
name="field" |
|
|
|
|
label={"رشته تحصیلی"} |
|
|
|
|
selectedOptions={this.state.gradeId} |
|
|
|
|
/> |
|
|
|
|
) : null} |
|
|
|
|
|
|
|
|
|
<Select |
|
|
|
|
parent={this} |
|
|
|
|
options={[ |
|
|
|
|
"1", |
|
|
|
|
"2", |
|
|
|
|
"3", |
|
|
|
|
"4", |
|
|
|
|
"5", |
|
|
|
|
"6", |
|
|
|
|
"7", |
|
|
|
|
"8", |
|
|
|
|
"9", |
|
|
|
|
"10", |
|
|
|
|
"11", |
|
|
|
|
"12", |
|
|
|
|
]} |
|
|
|
|
name="gradeId" |
|
|
|
|
label={"پایه تحصیلی"} |
|
|
|
|
options={["karaj", "tehran"]} |
|
|
|
|
name="provinceId" |
|
|
|
|
label={"استان"} |
|
|
|
|
/> |
|
|
|
|
) : null} |
|
|
|
|
{this.state.userRoleId === "معلم" ? ( |
|
|
|
|
<MultipleSelector |
|
|
|
|
<Select |
|
|
|
|
parent={this} |
|
|
|
|
options={[ |
|
|
|
|
"1", |
|
|
|
|
"2", |
|
|
|
|
"3", |
|
|
|
|
"4", |
|
|
|
|
"5", |
|
|
|
|
"6", |
|
|
|
|
"7", |
|
|
|
|
"8", |
|
|
|
|
"9", |
|
|
|
|
"10", |
|
|
|
|
"11", |
|
|
|
|
"12", |
|
|
|
|
]} |
|
|
|
|
name="gradeId" |
|
|
|
|
label={"پایه تحصیلی"} |
|
|
|
|
selectedOptions={this.state.gradeId} |
|
|
|
|
options={["karaj", "tehran"]} |
|
|
|
|
name="cityId" |
|
|
|
|
label={"شهرستان"} |
|
|
|
|
/> |
|
|
|
|
) : null} |
|
|
|
|
{this.state.userRoleId === "دانش آموز" && |
|
|
|
|
this.state.gradeId.length > 0 ? ( |
|
|
|
|
<Select |
|
|
|
|
parent={this} |
|
|
|
|
options={[ |
|
|
|
|
"ریاضی", |
|
|
|
|
"تجربی", |
|
|
|
|
"انسانی", |
|
|
|
|
"فنی حرفهای", |
|
|
|
|
"کاردانش", |
|
|
|
|
"معارف", |
|
|
|
|
]} |
|
|
|
|
name="field" |
|
|
|
|
label={"رشته تحصیلی"} |
|
|
|
|
selectedOptions={this.state.gradeId} |
|
|
|
|
options={["chaharbagh", "mahalat"]} |
|
|
|
|
name="zoneId" |
|
|
|
|
label={"شهر/روستا"} |
|
|
|
|
/> |
|
|
|
|
) : null} |
|
|
|
|
|
|
|
|
|
<Select |
|
|
|
|
parent={this} |
|
|
|
|
options={["karaj", "tehran"]} |
|
|
|
|
name="provinceId" |
|
|
|
|
label={"استان"} |
|
|
|
|
/> |
|
|
|
|
<Select |
|
|
|
|
parent={this} |
|
|
|
|
options={["karaj", "tehran"]} |
|
|
|
|
name="cityId" |
|
|
|
|
label={"شهرستان"} |
|
|
|
|
/> |
|
|
|
|
<Select |
|
|
|
|
parent={this} |
|
|
|
|
options={["chaharbagh", "mahalat"]} |
|
|
|
|
name="zoneId" |
|
|
|
|
label={"شهر/روستا"} |
|
|
|
|
/> |
|
|
|
|
{this.state.userRoleId === "دانش آموز" ? ( |
|
|
|
|
<Input parent={this} name="schoolId" label={"نام مدرسه"} /> |
|
|
|
|
) : null} |
|
|
|
|
{this.state.userRoleId === "معلم" ? ( |
|
|
|
|
<Input parent={this} name="schoolId" label={"محل تدریس"} /> |
|
|
|
|
) : null} |
|
|
|
|
<Input |
|
|
|
|
parent={this} |
|
|
|
|
name="postalCode" |
|
|
|
|
label={"کد پستی"} |
|
|
|
|
align="left" |
|
|
|
|
/> |
|
|
|
|
<TextArea parent={this} label={"آدرس محل سکونت"} name="address" /> |
|
|
|
|
<div className="mobile-auth-profile__footer d-flex justify-content-center"> |
|
|
|
|
<button onClick={() => this.onSubmit()}>ذخیره</button> |
|
|
|
|
{this.state.userRoleId === "دانش آموز" ? ( |
|
|
|
|
<Input |
|
|
|
|
parent={this} |
|
|
|
|
name="schoolId" |
|
|
|
|
label={"نام مدرسه"} |
|
|
|
|
defaultValue={profile} |
|
|
|
|
/> |
|
|
|
|
) : null} |
|
|
|
|
{this.state.userRoleId === "معلم" ? ( |
|
|
|
|
<Input |
|
|
|
|
parent={this} |
|
|
|
|
name="schoolId" |
|
|
|
|
label={"محل تدریس"} |
|
|
|
|
defaultValue={profile} |
|
|
|
|
/> |
|
|
|
|
) : null} |
|
|
|
|
<Input |
|
|
|
|
parent={this} |
|
|
|
|
name="postalCode" |
|
|
|
|
label={"کد پستی"} |
|
|
|
|
align="left" |
|
|
|
|
defaultValue={profile} |
|
|
|
|
/> |
|
|
|
|
<TextArea parent={this} label={"آدرس محل سکونت"} name="address" /> |
|
|
|
|
<div className="mobile-auth-profile__footer d-flex justify-content-center"> |
|
|
|
|
<button onClick={() => this.onSubmit()}>ذخیره</button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
) : ( |
|
|
|
|
<div |
|
|
|
|
className="d-flex justify-content-center align-items-center" |
|
|
|
|
style={{ height: "100vh", width: "100vw" }} |
|
|
|
|
> |
|
|
|
|
<Loader /> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
) |
|
|
|
|
) : null} |
|
|
|
|
</> |
|
|
|
|
); |
|
|
|
@ -445,7 +481,8 @@ class Profile extends Component { |
|
|
|
|
|
|
|
|
|
export default connect( |
|
|
|
|
(state) => ({ |
|
|
|
|
profile: state.user.status.profile || {}, |
|
|
|
|
profile: state.user.status || {}, |
|
|
|
|
loading: state.user.loading, |
|
|
|
|
}), |
|
|
|
|
{ getProfile: user.getProfile, setProfile: user.setProfile } |
|
|
|
|
)(Profile); |
|
|
|
|