diff --git a/frontend/src/UIComponents/customInput/CustomInput.tsx b/frontend/src/UIComponents/customInput/CustomInput.tsx new file mode 100644 index 0000000..f12fee8 --- /dev/null +++ b/frontend/src/UIComponents/customInput/CustomInput.tsx @@ -0,0 +1,30 @@ +import React from 'react'; +import authStore from "../../store/authStore.ts"; +import "./customInput.scss" + +interface IPropTypes { + placeholder: string, + value: string, + handleOnChange: (e: string) => void, + type: string, + autoFocus?: boolean +} + +const CustomInput: React.FC = ({placeholder, value, handleOnChange, type, autoFocus}) => { + return ( +
+ { + handleOnChange(e.target.value) + authStore.changeUserLogin(e.target.value) + authStore.changeUserEmail(e.target.value) + }} + autoFocus={autoFocus !== undefined ? autoFocus : false} + /> +
+ ); +}; + +export default CustomInput; diff --git a/frontend/src/UIComponents/customInput/customInput.scss b/frontend/src/UIComponents/customInput/customInput.scss new file mode 100644 index 0000000..d566a70 --- /dev/null +++ b/frontend/src/UIComponents/customInput/customInput.scss @@ -0,0 +1,21 @@ +@import "./../../styles/variablesStyles"; +.custom-input { + margin-top: 15px; + background: $inputBGColor; + border-radius: 30px; + + > input { + font-size: 16px; + color: $inputTextColor; + left: 10%; + width: 80%; + height: 70px; + background: none; + border: none; + + &:focus { + border: none; + outline: none; + } + } +} diff --git a/frontend/src/components/authentication/Authentication.tsx b/frontend/src/components/authentication/Authentication.tsx index 0ea63c8..59588c3 100644 --- a/frontend/src/components/authentication/Authentication.tsx +++ b/frontend/src/components/authentication/Authentication.tsx @@ -5,6 +5,7 @@ import CustomCheckbox from "../../UIComponents/customCheckbox/CustomCheckbox.tsx import authStore from "../../store/authStore.ts"; import {observer} from "mobx-react-lite"; import {useNavigate} from "react-router-dom"; +import CustomInput from "../../UIComponents/customInput/CustomInput.tsx"; const Authentication: React.FC = observer(() => { const navigateTo = useNavigate() @@ -21,17 +22,10 @@ const Authentication: React.FC = observer(() => {

ВХОД

-
- { - authStore.changeUserLogin(e.target.value) - authStore.changeUserEmail(e.target.value) - }} - autoFocus={true} - /> -
+ { + authStore.changeUserLogin(e.target.value) + authStore.changeUserEmail(e.target.value) + }} autoFocus={true} placeholder="Логин"/>