Skip to content

Commit

Permalink
применяет кастомные инпуты при авторизации
Browse files Browse the repository at this point in the history
  • Loading branch information
semant1cs committed Nov 20, 2023
1 parent 2e10651 commit 78f45a3
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 11 deletions.
3 changes: 0 additions & 3 deletions frontend/src/UIComponents/customInput/CustomInput.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
import authStore from "../../store/authStore.ts";
import "./customInput.scss"

interface IPropTypes {
Expand All @@ -18,8 +17,6 @@ const CustomInput: React.FC<IPropTypes> = ({placeholder, value, handleOnChange,
value={value}
onChange={(e) => {
handleOnChange(e.target.value)
authStore.changeUserLogin(e.target.value)
authStore.changeUserEmail(e.target.value)
}}
autoFocus={autoFocus !== undefined ? autoFocus : false}
/>
Expand Down
20 changes: 20 additions & 0 deletions frontend/src/UIComponents/customInput/customInput.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/src/UIComponents/customInput/customInput.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions frontend/src/components/authentication/Authentication.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ const Authentication: React.FC = observer(() => {
<form className="auth__form">
<h2 className="auth-form-title">ВХОД</h2>
<fieldset className="auth-fields">
<CustomInput type="email" value="" handleOnChange={(e) => {
authStore.changeUserLogin(e.target.value)
authStore.changeUserEmail(e.target.value)
}} autoFocus={true} placeholder="Логин"/>
<CustomInput type="email" value={authStore.userLogin} handleOnChange={(e) => {
authStore.changeUserLogin(e)
authStore.changeUserEmail(e)
}}
autoFocus={true} placeholder="Логин"/>
<div className="auth-data__field">
<input type={isPasswordShows ? "text" : "password"} className="password__input"
value={authStore.userPassword}
onChange={(e) => authStore.changeUserPassword(e.target.value)}
placeholder="Пароль"/>
<CustomInput type={isPasswordShows ? "text" : "password"} placeholder="Пароль"
value={authStore.userPassword}
handleOnChange={(e) => authStore.changeUserPassword(e)}/>
</div>
</fieldset>
<CustomCheckbox text="Показать пароль" id="is-remember"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 78f45a3

Please sign in to comment.