-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Перенесла карточку сотрудника в папку попапа, использовала попап для …
…создания дочернего попапа
- Loading branch information
Showing
4 changed files
with
95 additions
and
69 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
11 changes: 9 additions & 2 deletions
11
...nents/NewEmployee/NewEmployee.module.scss → ...Popup/NewEmployee/NewEmployee.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import React, { useState } from 'react'; | ||
import UniversalInput from 'ui-lib/Inputs/UniversalInput/UniversalInput'; | ||
import EmailInput from 'ui-lib/Inputs/EmailInput/EmailInput'; | ||
import PasswordInput from 'ui-lib/Inputs/PasswordInput/PasswordInput'; | ||
import { UniversalButton } from 'ui-lib/Buttons'; | ||
import Popup from '../Popup'; | ||
import styles from './NewEmployee.module.scss'; | ||
import additionalStyles from '../../../ui-lib/Inputs/UniversalInput/UniversalInput.module.scss'; | ||
|
||
const NewEmployeePopup: React.FC<{ closePopup: () => void }> = ({ closePopup }) => { | ||
const name = ''; | ||
const lastName = ''; | ||
const email = ''; | ||
const nickname = ''; | ||
const password = ''; | ||
const errorText = ''; | ||
const [isValid, setIslValid] = useState(false); | ||
|
||
const handleCancel = () => { | ||
closePopup(); | ||
}; | ||
return ( | ||
<Popup isOpen onClose={closePopup}> | ||
<form className={styles.newEmployee}> | ||
<div className={styles.newEmployeeContainer}> | ||
<div className={styles.newEmployeeWrapper}> | ||
<UniversalInput | ||
className={styles.nameEmployee} | ||
id={name} | ||
label='Имя' | ||
placeholder='Иван' | ||
width={246.5} | ||
/> | ||
<UniversalInput | ||
className={styles.nameEmployee} | ||
id={lastName} | ||
label='Фамилия' | ||
placeholder='Иванов' | ||
width={246.5} | ||
/> | ||
</div> | ||
<UniversalInput | ||
className={`${additionalStyles.input} ${isValid ? styles.invalidInput : ''}`} | ||
id={nickname} | ||
label='Telegram' | ||
placeholder='@BorKate' | ||
/> | ||
{isValid && <p className={styles.errorText}>{errorText}</p>} | ||
<EmailInput | ||
className={`${additionalStyles.input} ${isValid ? styles.invalidInput : ''}`} | ||
id={email} | ||
/> | ||
{isValid && <p className={styles.errorText}>{errorText}</p>} | ||
<PasswordInput id={password} /> | ||
<div className={styles.newEmployeeWrapper}> | ||
<UniversalButton className={styles.newEmployeeAddButton} width={246.5}> | ||
Добавить сотрудника | ||
</UniversalButton> | ||
<UniversalButton | ||
className={styles.newEmployeeButton} | ||
isFilled={false} | ||
width={246.5} | ||
onClick={handleCancel} | ||
> | ||
Отменить | ||
</UniversalButton> | ||
</div> | ||
</div> | ||
</form> | ||
</Popup> | ||
); | ||
}; | ||
|
||
export default NewEmployeePopup; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters