Skip to content

Commit

Permalink
Готова форма добавления нового сотрудника
Browse files Browse the repository at this point in the history
  • Loading branch information
DinaraMi committed Feb 1, 2024
1 parent 1e7cda7 commit 57e7c2c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
13 changes: 11 additions & 2 deletions src/components/NewEmployee/NewEmployee.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

.newEmployeeWrapper {
display: flex;
gap: 16px;
justify-content: space-between;
}

Expand All @@ -20,12 +21,20 @@
@include m.BodyLarge;
}

.invalidInput {
border: 1px solid v.$error;
}

.newEmployeeAddButton {
width: 246.5px;
// background-color: v.$accent-color;
// color: v.$white-color;
}

.newEmployeeButton {
width: 246.5px;
}

.errorText {
color: v.$error;
@include m.Description;
margin-top: -10px;
}
18 changes: 16 additions & 2 deletions src/components/NewEmployee/NewEmployee.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import { 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 styles from './NewEmployee.module.scss';
import additionalStyles from '../../ui-lib/Inputs/UniversalInput/UniversalInput.module.scss';

const NewEmployee = () => {
const name = '';
const lastName = '';
const email = '';
const nickname = '';
const password = '';
const errorText = '';
const [isValid, setIslValid] = useState(false);
return (
<form className={styles.newEmployee}>
<div className={styles.newEmployeeContainer}>
Expand All @@ -29,8 +33,18 @@ const NewEmployee = () => {
width={246.5}
/>
</div>
<EmailInput id={email} />
<UniversalInput id={nickname} label='Telegram' placeholder='@BorKate' />
<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}>
Expand Down
2 changes: 0 additions & 2 deletions src/pages/Login/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import Logo from 'components/Logo/Logo';
import AuthorizationForm from 'components/Forms/AuthorizationForm/AuthorizationForm';
import { useNavigate } from 'react-router-dom';
import { useSelector } from 'services/hooks';
import NewEmployee from 'components/NewEmployee/NewEmployee';
import styles from './Login.module.scss';

const Login = () => {
Expand All @@ -21,7 +20,6 @@ const Login = () => {
</div>
<h1 className={styles.Login__title}>Добро пожаловать в Шорт-трекер</h1>
<AuthorizationForm />
<NewEmployee />
</main>
);
};
Expand Down

0 comments on commit 57e7c2c

Please sign in to comment.