From 0e2e972eb370a803aac8597099f294430808fe79 Mon Sep 17 00:00:00 2001 From: Nikola LEGAY Date: Wed, 24 Jul 2024 09:27:21 +0200 Subject: [PATCH] feat: Add useTranslation on FieldPassword --- src/components/Form/FieldPassword/index.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/Form/FieldPassword/index.tsx b/src/components/Form/FieldPassword/index.tsx index d8181f61d..06686c2ab 100644 --- a/src/components/Form/FieldPassword/index.tsx +++ b/src/components/Form/FieldPassword/index.tsx @@ -16,6 +16,7 @@ import { FieldPath, FieldValues, } from 'react-hook-form'; +import { useTranslation } from 'react-i18next'; import { RiEyeCloseLine, RiEyeLine } from 'react-icons/ri'; import { FieldCommonProps } from '@/components/Form/FormFieldController'; @@ -38,6 +39,7 @@ export const FieldPassword = < >( props: FieldPasswordProps ) => { + const { t } = useTranslation(); const [showPassword, setShowPassword] = useState(false); return ( setShowPassword((x) => !x)} - aria-label={showPassword ? 'Hide password' : 'Show password'} // TODO: translation + aria-label={ + showPassword + ? t('password.hide', 'Hide password') + : t('password.show', 'Show password') + } display="flex" size="xs" fontSize="lg"