diff --git a/frontend/src/bundles/auth/components/sign-up-form/sign-up-form.tsx b/frontend/src/bundles/auth/components/sign-up-form/sign-up-form.tsx index d00052912..98bcdffa0 100644 --- a/frontend/src/bundles/auth/components/sign-up-form/sign-up-form.tsx +++ b/frontend/src/bundles/auth/components/sign-up-form/sign-up-form.tsx @@ -4,21 +4,18 @@ import { Box, Button, FormProvider, - Heading, Input, Link, - PasswordInput, - Text, VStack, } from '~/bundles/common/components/components.js'; -import { FormError } from '~/bundles/common/components/form-error/form-error.js'; import { AppRoute, DataStatus } from '~/bundles/common/enums/enums.js'; -import { useAppForm, useAppSelector } from '~/bundles/common/hooks/hooks.js'; +import { useAppForm, useAppSelector, useMemo } from '~/bundles/common/hooks/hooks.js'; import { type UserSignUpRequestDto, userSignUpValidationSchema, } from '~/bundles/users/users.js'; +import { FormError, FormHeader, PasswordInput } from '../common/components.js'; import { DEFAULT_SIGN_UP_PAYLOAD } from './constants/constants.js'; type Properties = { @@ -33,18 +30,29 @@ const SignUpForm: React.FC = ({ onSubmit }) => { initialValues: DEFAULT_SIGN_UP_PAYLOAD, validationSchema: userSignUpValidationSchema, onSubmit, - mode: 'onChange', }); - const { handleSubmit, isValid } = form; + const { handleSubmit, errors, values } = form; + + const isEmpty = useMemo( + () => Object.values(values).some((value) => value.trim().length === 0), + [values], + ); return ( - - Create an account - Already registerd? - Log In - + + + Already registerd?{' '} + + Log In + + + } + />
= ({ onSubmit }) => { /> +