From bd3558e38bb31e3c0e44630184a27c6ce217688f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ot=C3=A1vio=20Stasiak?= <91474186+OtavioStasiak@users.noreply.github.com> Date: Tue, 7 Jan 2025 21:30:17 -0300 Subject: [PATCH] chore(a11y): TwoFactor (#6048) --- app/containers/TextInput/FormTextInput.tsx | 2 +- app/containers/TwoFactor/index.tsx | 24 ++++++++++++++++------ app/containers/TwoFactor/styles.ts | 18 ++++++++++++---- app/i18n/locales/ar.json | 4 +++- app/i18n/locales/bn-IN.json | 4 +++- app/i18n/locales/cs.json | 4 +++- app/i18n/locales/de.json | 4 +++- app/i18n/locales/en.json | 4 +++- app/i18n/locales/es.json | 4 +++- app/i18n/locales/fi.json | 4 +++- app/i18n/locales/fr.json | 4 +++- app/i18n/locales/hi-IN.json | 4 +++- app/i18n/locales/hu.json | 4 +++- app/i18n/locales/it.json | 4 +++- app/i18n/locales/ja.json | 4 +++- app/i18n/locales/nl.json | 4 +++- app/i18n/locales/pt-BR.json | 4 +++- app/i18n/locales/pt-PT.json | 4 +++- app/i18n/locales/ru.json | 4 +++- app/i18n/locales/sl-SI.json | 4 +++- app/i18n/locales/sv.json | 4 +++- app/i18n/locales/ta-IN.json | 4 +++- app/i18n/locales/te-IN.json | 4 +++- app/i18n/locales/tr.json | 4 +++- app/i18n/locales/zh-CN.json | 4 +++- app/i18n/locales/zh-TW.json | 4 +++- app/lib/constants/colors.ts | 4 ++++ 27 files changed, 106 insertions(+), 34 deletions(-) diff --git a/app/containers/TextInput/FormTextInput.tsx b/app/containers/TextInput/FormTextInput.tsx index 5c208d9659..a3b7e27638 100644 --- a/app/containers/TextInput/FormTextInput.tsx +++ b/app/containers/TextInput/FormTextInput.tsx @@ -100,7 +100,7 @@ export const FormTextInput = ({ return ( {label ? ( diff --git a/app/containers/TwoFactor/index.tsx b/app/containers/TwoFactor/index.tsx index dc0dcde1c5..785df41849 100644 --- a/app/containers/TwoFactor/index.tsx +++ b/app/containers/TwoFactor/index.tsx @@ -80,7 +80,7 @@ const TwoFactor = React.memo(() => { } } } catch (e) { - log(e) + log(e); } }; @@ -93,7 +93,9 @@ const TwoFactor = React.memo(() => { } }, [data]); - const showTwoFactor = (args: EventListenerMethod) => setData(args); + const showTwoFactor = (args: EventListenerMethod) => { + setData(args); + }; useEffect(() => { const listener = EventEmitter.addEventListener(TWO_FACTOR, showTwoFactor); @@ -123,7 +125,12 @@ const TwoFactor = React.memo(() => { const color = colors.fontTitlesLabels; return ( - + } + avoidKeyboard + useNativeDriver + isVisible={visible} + hideModalContentWhileAnimating> { {I18n.t(method?.title || 'Two_Factor_Authentication')} {method?.text ? {I18n.t(method.text)} : null} InteractionManager.runAfterInteractions(() => e?.getNativeRef()?.focus())} returnKeyType='send' autoCapitalize='none' + testID='two-factor-input' + accessibilityLabel={I18n.t( + data?.method === 'password' ? 'Label_Input_Two_Factor_Password' : 'Label_Input_Two_Factor_Code' + )} + value={code} + inputRef={(e: any) => InteractionManager.runAfterInteractions(() => e?.getNativeRef()?.focus())} onChangeText={setCode} onSubmitEditing={onSubmit} keyboardType={method?.keyboardType} secureTextEntry={method?.secureTextEntry} error={data.invalid ? { error: 'totp-invalid', reason: I18n.t('Code_or_password_invalid') } : undefined} - testID='two-factor-input' + containerStyle={styles.containerInput} /> + {isEmail ? (