@@ -21,6 +21,7 @@ import { API_URL } from '#/shared/lib/constants/constants' import { useShowData } from '#/shared/lib/hooks' import { useThemeAndDevice } from '#/shared/lib/hooks' import OpenedEyeSvg from '#/assets/svg/opened-eye.svg?react' +import ClosedEyeSvg from '#/assets/svg/closed-eye.svg?react' interface IRegisterEmailFormProps { successLogin: () => void @@ -44,14 +45,15 @@ export const RegisterEmailForm: React.FC = ({ successLo const [cookie] = useCookies() const [passwordShowed, showPassword] = React.useState(false) - const makeNewAccount: SubmitHandler = async (data) => { setLoading(true) if (!data.rules) { showError('Запрос отправлен', true) try { - const { status } = await axios.get(API_URL + `/auth/mail/whitelist?email=${data.email}`) + const { status } = await axios.get( + API_URL + `/auth/mail/whitelist?email=${data.email}` + ) if (status === 200) { setIsEmailWhite(true) } @@ -155,11 +157,24 @@ export const RegisterEmailForm: React.FC = ({ successLo type={passwordShowed ? 'text' : 'password'} fullWidth InputProps={{ - endAdornment: -
showPassword((x) => !x)} style={{ cursor: 'pointer', display: 'flex', alignItems: 'center' }}> - -
-
+ endAdornment: ( + +
showPassword((x) => !x)} + style={{ + cursor: 'pointer', + display: 'flex', + alignItems: 'center', + }} + > + {passwordShowed ? ( + + ) : ( + + )} +
+
+ ), }} sx={theme === 'light' ? { ...InputStyleLight } : { ...InputStyleDark }} {...register('password1', { @@ -196,7 +211,11 @@ export const RegisterEmailForm: React.FC = ({ successLo })} /> - + { const device = getDeviceType() @@ -59,10 +60,12 @@ const Login: NextPageWithLayout = () => { redirect: false, }) if (resp && !resp.ok && resp.error && resp.error !== '') { - showError(Object.keys(ERROR_MAPPING).reduce( - (prev, curr) => ({ ...prev, [ERROR_MAPPING[curr]]: curr }), - {} as Record - )[resp.error ?? ''] ?? 'Непредвиденная ошибка') + showError( + Object.keys(ERROR_MAPPING).reduce( + (prev, curr) => ({ ...prev, [ERROR_MAPPING[curr]]: curr }), + {} as Record + )[resp.error ?? ''] ?? 'Непредвиденная ошибка' + ) Sentry.captureMessage(resp.error, 'warning') setLoading(false) } else { @@ -259,11 +262,34 @@ const Login: NextPageWithLayout = () => { type={passwordShowed ? 'text' : 'password'} fullWidth InputProps={{ - endAdornment: -
showPassword((x) => !x)} style={{ cursor: 'pointer', display: 'flex', alignItems: 'center' }}> - -
-
+ endAdornment: ( + +
+ showPassword((x) => !x) + } + style={{ + cursor: 'pointer', + display: 'flex', + alignItems: 'center', + }} + > + {passwordShowed ? ( + + ) : ( + + )} +
+
+ ), }} sx={ theme === 'light'