diff --git a/packages/ui/src/components/InputFields/InputField/index.test.tsx b/packages/ui/src/components/InputFields/InputField/index.test.tsx
index 5c170ca41..0e4a53c73 100644
--- a/packages/ui/src/components/InputFields/InputField/index.test.tsx
+++ b/packages/ui/src/components/InputFields/InputField/index.test.tsx
@@ -31,7 +31,7 @@ describe('InputField Component', () => {
test('render error message', () => {
const errorCode = 'invalid_email';
- const { queryByText } = render();
+ const { queryByText } = render();
expect(queryByText(errorCode)).not.toBeNull();
});
diff --git a/packages/ui/src/components/InputFields/InputField/index.tsx b/packages/ui/src/components/InputFields/InputField/index.tsx
index 4e5ffa661..c247e33ed 100644
--- a/packages/ui/src/components/InputFields/InputField/index.tsx
+++ b/packages/ui/src/components/InputFields/InputField/index.tsx
@@ -2,14 +2,13 @@ import classNames from 'classnames';
import type { ForwardedRef, HTMLProps, ReactElement } from 'react';
import { forwardRef, cloneElement } from 'react';
-import type { ErrorType } from '@/components/ErrorMessage';
import ErrorMessage from '@/components/ErrorMessage';
import * as styles from './index.module.scss';
export type Props = Omit, 'prefix'> & {
className?: string;
- error?: ErrorType;
+ errorMessage?: string;
isDanger?: boolean;
prefix?: ReactElement;
isPrefixVisible?: boolean;
@@ -21,7 +20,7 @@ export type Props = Omit, 'prefix'> & {
const InputField = (
{
className,
- error,
+ errorMessage,
isDanger,
prefix,
suffix,
@@ -49,7 +48,7 @@ const InputField = (
className: classNames([suffix.props.className, styles.suffix]),
})}
- {error && }
+ {errorMessage && {errorMessage}}
);
diff --git a/packages/ui/src/components/InputFields/PasswordInputField/index.test.tsx b/packages/ui/src/components/InputFields/PasswordInputField/index.test.tsx
index 25cc0eb62..2479d3692 100644
--- a/packages/ui/src/components/InputFields/PasswordInputField/index.test.tsx
+++ b/packages/ui/src/components/InputFields/PasswordInputField/index.test.tsx
@@ -31,7 +31,7 @@ describe('Input Field UI Component', () => {
test('render error message', () => {
const errorCode = 'password_required';
- const { queryByText } = render();
+ const { queryByText } = render();
expect(queryByText(errorCode)).not.toBeNull();
});
diff --git a/packages/ui/src/components/InputFields/SmartInputField/index.tsx b/packages/ui/src/components/InputFields/SmartInputField/index.tsx
index 06ead1dec..a0ff66233 100644
--- a/packages/ui/src/components/InputFields/SmartInputField/index.tsx
+++ b/packages/ui/src/components/InputFields/SmartInputField/index.tsx
@@ -6,7 +6,6 @@ import { useImperativeHandle, useRef, forwardRef } from 'react';
import ClearIcon from '@/assets/icons/clear-icon.svg';
import IconButton from '@/components/Button/IconButton';
-import type { ErrorType } from '@/components/ErrorMessage';
import InputField from '../InputField';
import AnimatedPrefix from './AnimatedPrefix';
@@ -19,7 +18,7 @@ export type { IdentifierInputType, EnabledIdentifierTypes } from './use-smart-in
type Props = Omit, 'onChange' | 'prefix'> & {
className?: string;
- error?: ErrorType;
+ errorMessage?: string;
isDanger?: boolean;
enabledTypes?: EnabledIdentifierTypes;
diff --git a/packages/ui/src/containers/SetPassword/index.test.tsx b/packages/ui/src/containers/SetPassword/index.test.tsx
index daaf29c3f..845bebb2a 100644
--- a/packages/ui/src/containers/SetPassword/index.test.tsx
+++ b/packages/ui/src/containers/SetPassword/index.test.tsx
@@ -34,7 +34,7 @@ describe('', () => {
expect(clearError).toBeCalled();
await waitFor(() => {
- expect(queryByText('password_required')).not.toBeNull();
+ expect(queryByText('error.password_required')).not.toBeNull();
});
expect(submit).not.toBeCalled();
@@ -54,7 +54,7 @@ describe('', () => {
});
await waitFor(() => {
- expect(queryByText('password_min_length')).not.toBeNull();
+ expect(queryByText('error.password_min_length')).not.toBeNull();
});
expect(submit).not.toBeCalled();
@@ -67,7 +67,7 @@ describe('', () => {
});
await waitFor(() => {
- expect(queryByText('password_min_length')).toBeNull();
+ expect(queryByText('error.password_min_length')).toBeNull();
});
});
@@ -90,7 +90,7 @@ describe('', () => {
});
await waitFor(() => {
- expect(queryByText('passwords_do_not_match')).not.toBeNull();
+ expect(queryByText('error.passwords_do_not_match')).not.toBeNull();
});
expect(submit).not.toBeCalled();
@@ -103,7 +103,7 @@ describe('', () => {
});
await waitFor(() => {
- expect(queryByText('passwords_do_not_match')).toBeNull();
+ expect(queryByText('error.passwords_do_not_match')).toBeNull();
});
});
@@ -125,7 +125,7 @@ describe('', () => {
fireEvent.submit(submitButton);
});
- expect(queryByText('passwords_do_not_match')).toBeNull();
+ expect(queryByText('error.passwords_do_not_match')).toBeNull();
await waitFor(() => {
expect(submit).toBeCalledWith('123456');
diff --git a/packages/ui/src/containers/SetPassword/index.tsx b/packages/ui/src/containers/SetPassword/index.tsx
index 3f8b65f58..409b4a094 100644
--- a/packages/ui/src/containers/SetPassword/index.tsx
+++ b/packages/ui/src/containers/SetPassword/index.tsx
@@ -8,7 +8,6 @@ import Button from '@/components/Button';
import IconButton from '@/components/Button/IconButton';
import ErrorMessage from '@/components/ErrorMessage';
import { InputField } from '@/components/InputFields';
-import { passwordErrorWatcher } from '@/utils/form';
import TogglePassword from './TogglePassword';
import * as styles from './index.module.scss';
@@ -61,21 +60,24 @@ const SetPassword = ({
[clearErrorMessage, handleSubmit, onSubmit]
);
- const newPasswordError = passwordErrorWatcher(errors.newPassword);
-
return (