implement user profile

This commit is contained in:
Yasiu1376
2023-07-12 11:01:07 +03:30
parent a2b8920466
commit 08672c0a1e

View File

@@ -6,6 +6,7 @@ import {
Box,
Button,
Container,
Grid,
Paper,
Stack,
TextField,
@@ -50,7 +51,6 @@ const DashboardEditProfile = () => {
const handleSubmit = (values, { setSubmitting }) => {
// const formData = new FormData();
// formData.append("email", values.expert_email);
// if (values.change_avatar !== false) {
// editAvatar(values.expert_avatar)
// .then(() => {
@@ -140,30 +140,122 @@ const DashboardEditProfile = () => {
changeFlag="change_avatar"
/>
</Box>
<Stack spacing={1} component="div">
<Field
as={TextField}
name="expert_email"
label={t("UpdateProfile.text_field_email")}
variant="outlined"
margin="normal"
size="small"
error={
props.touched.expert_email &&
props.errors.expert_email
? true
: false
}
helperText={
props.touched.expert_email
? props.errors.expert_email
: null
}
sx={{
width: "100%",
}}
/>
</Stack>
<Grid container spacing={2} sx={{ pb: 2 }}>
<Grid item xs={12} sm={6}>
<Field
as={TextField}
name="username"
label={t("text_field_username")}
variant="outlined"
margin="normal"
size="small"
error={
props.touched.username && props.errors.username
? true
: false
}
helperText={
props.touched.username
? props.errors.username
: null
}
sx={{
width: "100%",
}}
/>
</Grid>
<Grid item xs={12} sm={6}>
<Field
as={TextField}
name="name"
label={t("text_field_name")}
variant="outlined"
margin="normal"
size="small"
error={
props.touched.name && props.errors.name
? true
: false
}
helperText={
props.touched.name ? props.errors.name : null
}
sx={{
width: "100%",
}}
/>
</Grid>
<Grid item xs={12} sm={6}>
<Field
as={TextField}
name="email"
label={t("text_field_name")}
variant="outlined"
margin="normal"
size="small"
error={
props.touched.name && props.errors.name
? true
: false
}
helperText={
props.touched.name ? props.errors.name : null
}
sx={{
width: "100%",
}}
/>
</Grid>
<Grid item xs={12} sm={6}>
<Field
as={TextField}
name="position"
label={t("text_field_phone_number")}
variant="outlined"
margin="normal"
size="small"
error={
props.touched.phone_number &&
props.errors.phone_number
? true
: false
}
helperText={
props.touched.phone_number
? props.errors.phone_number
: null
}
sx={{
width: "100%",
}}
/>
</Grid>
<Grid item xs={12} sm={6}>
<Field
as={TextField}
name="province_name"
label={t("text_field_national_id_code")}
variant="outlined"
margin="normal"
size="small"
error={
props.touched.national_id_code &&
props.errors.national_id_code
? true
: false
}
helperText={
props.touched.national_id_code
? props.errors.national_id_code
: null
}
sx={{
width: "100%",
}}
/>
</Grid>
</Grid>
<Button
type="submit"
fullWidth