From 9158fe2b6f7514e9f35ed4726e1b47e4fa185493 Mon Sep 17 00:00:00 2001 From: JKaypa Date: Tue, 17 Sep 2024 10:59:03 -0500 Subject: [PATCH 01/27] OV-258: - removed FormError component due to error message duplication --- .../auth/components/common/components.ts | 1 - .../common/form-error/form-error.tsx | 19 ----------------- .../components/sign-in-form/sign-in-form.tsx | 20 ++---------------- .../components/sign-up-form/sign-up-form.tsx | 21 +++---------------- .../theme/styles/components.styles.ts | 7 ------- 5 files changed, 5 insertions(+), 63 deletions(-) delete mode 100644 frontend/src/bundles/auth/components/common/form-error/form-error.tsx diff --git a/frontend/src/bundles/auth/components/common/components.ts b/frontend/src/bundles/auth/components/common/components.ts index 22726d9a9..ecda37021 100644 --- a/frontend/src/bundles/auth/components/common/components.ts +++ b/frontend/src/bundles/auth/components/common/components.ts @@ -1,3 +1,2 @@ -export { FormError } from './form-error/form-error.js'; export { FormHeader } from './form-header/form-header.js'; export { PasswordInput } from './password-input/password-input.js'; diff --git a/frontend/src/bundles/auth/components/common/form-error/form-error.tsx b/frontend/src/bundles/auth/components/common/form-error/form-error.tsx deleted file mode 100644 index 965799129..000000000 --- a/frontend/src/bundles/auth/components/common/form-error/form-error.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { - FormControl, - FormErrorMessage, -} from '~/bundles/common/components/components.js'; - -type Properties = { - isVisible: boolean; - message: string; -}; - -const FormError: React.FC = ({ isVisible, message }) => { - return ( - - {message} - - ); -}; - -export { FormError }; diff --git a/frontend/src/bundles/auth/components/sign-in-form/sign-in-form.tsx b/frontend/src/bundles/auth/components/sign-in-form/sign-in-form.tsx index 361c2b8aa..fc2a54e64 100644 --- a/frontend/src/bundles/auth/components/sign-in-form/sign-in-form.tsx +++ b/frontend/src/bundles/auth/components/sign-in-form/sign-in-form.tsx @@ -1,5 +1,4 @@ import { - FormError, FormHeader, PasswordInput, } from '~/bundles/auth/components/common/components.js'; @@ -11,16 +10,8 @@ import { Link, VStack, } from '~/bundles/common/components/components.js'; -import { - AppRoute, - DataStatus, - UserValidationMessage, -} from '~/bundles/common/enums/enums.js'; -import { - useAppForm, - useAppSelector, - useMemo, -} from '~/bundles/common/hooks/hooks.js'; +import { AppRoute } from '~/bundles/common/enums/enums.js'; +import { useAppForm, useMemo } from '~/bundles/common/hooks/hooks.js'; import { type UserSignInRequestDto, userSignInValidationSchema, @@ -33,9 +24,6 @@ type Properties = { }; const SignInForm: React.FC = ({ onSubmit }) => { - const { dataStatus } = useAppSelector(({ auth }) => ({ - dataStatus: auth.dataStatus, - })); const form = useAppForm({ initialValues: DEFAULT_SIGN_IN_PAYLOAD, validationSchema: userSignInValidationSchema, @@ -78,10 +66,6 @@ const SignInForm: React.FC = ({ onSubmit }) => { hasError={Boolean(errors.password)} required /> -