Skip to content

Commit

Permalink
fix edit profile and info profile
Browse files Browse the repository at this point in the history
  • Loading branch information
nenichv committed Jul 3, 2024
1 parent cbb0fbb commit bccb3cc
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const useChangeUserProfileFormValidators = () => {
],
[USER_EMAIL]: [
{
required: true,
message: PleaseInputYourEmailMsg,
whitespace: true,
type: 'email',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,18 @@ export function ProfileEdit() {
required={true}
label={'Ф. И. О.'}
name={USER_NAME}
rules={validators[USER_NAME]}
rules={[...validators[USER_NAME], { required: true, message: '' }]}
className={styles.label}
initialValue={initialValues[USER_NAME]}
>
<Input required={true} placeholder='Введите имя' />
<Input placeholder='Введите имя' />
</Form.Item>

<Form.Item
required={true}
label={'Email сотрудника'}
name={USER_EMAIL}
rules={validators[USER_EMAIL]}
rules={[...validators[USER_EMAIL], { required: true, message: '' }]}
className={styles.label}
initialValue={initialValues[USER_EMAIL]}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

.buttonsContainer {
gap: 20px;
margin-top: 50px;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,23 @@ export function ProfileInfo() {
</div>
) : (
results.data?.results.map((employee) => (
<div key={employee.id}>
<div key={employee.id} className={styles.organizationContainer}>
<Field
fieldName={'Организация:'}
fieldValue={employee.organization__name}
type={'center'}
type={'right'}
/>
<Field
fieldName={'Должность:'}
fieldValue={employee.position}
defaultValue={'Не определено'}
type={'center'}
type={'right'}
/>
</div>
))
)}

<Button type='schoolDefaultAuto' block onClick={() => router.push(RoutePath[AppRoutes.USER_EDIT])}>
<Button className={styles.editButton} type='schoolDefaultAuto' block onClick={() => router.push(RoutePath[AppRoutes.USER_EDIT])}>
Редактировать профиль
</Button>
</Col>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,11 @@
}
}
}

.editButton {
margin-top: 30px;
}

.organizationContainer {
margin-top: 60px;
}

0 comments on commit bccb3cc

Please sign in to comment.