Skip to content

Commit

Permalink
chore: updated accessibility experience and layout
Browse files Browse the repository at this point in the history
  • Loading branch information
OtavioStasiak committed Jan 8, 2025
1 parent a99ed5f commit e288fb6
Show file tree
Hide file tree
Showing 25 changed files with 29 additions and 51 deletions.
46 changes: 19 additions & 27 deletions app/containers/TwoFactor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,7 @@ const TwoFactor = React.memo(() => {
const color = colors.fontTitlesLabels;
return (
<Modal
customBackdrop={
<View
accessible
accessibilityLabel={I18n.t('Close_Modal')}
style={[styles.overlay, { backgroundColor: colors.overlayBackground }]}></View>
}
customBackdrop={<View aria-hidden style={[styles.overlay, { backgroundColor: colors.overlayBackground }]} />}
avoidKeyboard
useNativeDriver
isVisible={visible}
Expand All @@ -143,27 +138,24 @@ const TwoFactor = React.memo(() => {
isMasterDetail && [sharedStyles.modalFormSheet, styles.tablet],
{ backgroundColor: colors.surfaceTint }
]}>
<View
accessibilityLabel={`${method?.text ? I18n.t(method.text) : I18n.t(method?.title || 'Two_Factor_Authentication')}`}>
<Text style={[styles.title, { color }]}>{I18n.t(method?.title || 'Two_Factor_Authentication')}</Text>
{method?.text ? <Text style={[styles.subtitle, { color }]}>{I18n.t(method.text)}</Text> : null}
<FormTextInput
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())}
returnKeyType='send'
autoCapitalize='none'
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={{ marginBottom: 36 }}
/>
</View>
<Text style={[styles.title, { color }]}>{I18n.t(method?.title || 'Two_Factor_Authentication')}</Text>
{method?.text ? <Text style={[styles.subtitle, { color }]}>{I18n.t(method.text)}</Text> : null}
<FormTextInput
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}
containerStyle={styles.containerInput}
/>

{isEmail ? (
<Button
Expand Down
11 changes: 10 additions & 1 deletion app/containers/TwoFactor/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ export default StyleSheet.create({
},
buttonContainer: {
flexDirection: 'row',
justifyContent: 'space-between'
justifyContent: 'space-between',
marginTop: 36
},
tablet: {
height: undefined
Expand All @@ -47,5 +48,13 @@ export default StyleSheet.create({
flex: 1,
alignItems: 'center',
justifyContent: 'center'
},
containerInput: {
marginBottom: 0
},
resendEmailText: {
...sharedStyles.textBold,
fontSize: 12,
lineHeight: 18
}
});
1 change: 0 additions & 1 deletion app/i18n/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
"Click_to_join": "انقر للانضمام!",
"Close": "إغلاق",
"Close_emoji_selector": "إغلاق محدد الرموز التعبيرية",
"Close_Modal": "إغلاق النافذة المنبثقة",
"Code_or_password_invalid": "الرمز أو كلمة المرور خاطئة",
"Collaborative": "تعاونية",
"Confirm": "تأكيد",
Expand Down
1 change: 0 additions & 1 deletion app/i18n/locales/bn-IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@
"Close": "বন্ধ করুন",
"Close_Chat": "চ্যাট বন্ধ করুন",
"Close_emoji_selector": "ইমোজি সিলেক্টর বন্ধ করুন",
"Close_Modal": "মোডাল বন্ধ করুন।",
"Code_or_password_invalid": "কোড বা পাসওয়ার্ড অবৈধ",
"Collaborative": "সহযোগী",
"Condensed": "সংকোচিত",
Expand Down
1 change: 0 additions & 1 deletion app/i18n/locales/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@
"Close": "Zavřít",
"Close_Chat": "Zavřít chat",
"Close_emoji_selector": "Zavřít výběr emodži",
"Close_Modal": "Zavřít okno",
"Code_block": "Blok kódu",
"Code_or_password_invalid": "Neplatný kód nebo heslo",
"Collaborative": "Spolupráce",
Expand Down
1 change: 0 additions & 1 deletion app/i18n/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@
"Close": "Schließen",
"Close_Chat": "Chat schließen",
"Close_emoji_selector": "Emoji-Auswahl schließen",
"Close_Modal": "Modal schließen",
"Code_or_password_invalid": "Code oder Passwort sind falsch",
"Collaborative": "Kollaborativ",
"Condensed": "Komprimiert",
Expand Down
1 change: 0 additions & 1 deletion app/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@
"Close": "Close",
"Close_Chat": "Close chat",
"Close_emoji_selector": "Close emoji selector",
"Close_Modal": "Close Modal",
"Code_block": "Code block",
"Code_or_password_invalid": "Code or password invalid",
"Collaborative": "Collaborative",
Expand Down
1 change: 0 additions & 1 deletion app/i18n/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"Click_to_join": "¡Unirme!",
"Close": "Cerrar",
"Close_emoji_selector": "Cerrar selector de emojis",
"Close_Modal": "Cerrar modal",
"Collaborative": "Colaborativo",
"Confirm": "Confirmar",
"Connect": "Conectar",
Expand Down
1 change: 0 additions & 1 deletion app/i18n/locales/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@
"Close": "Sulje",
"Close_Chat": "Sulje keskustelu",
"Close_emoji_selector": "Sulje emojien valitsin",
"Close_Modal": "Sulje modalivalikko",
"Code_or_password_invalid": "Koodi tai salasana virheellinen",
"Collaborative": "Yhteistyö",
"Condensed": "Tiivistetty",
Expand Down
1 change: 0 additions & 1 deletion app/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"Click_to_join": "Cliquez pour rejoindre !",
"Close": "Fermer",
"Close_emoji_selector": "Fermer le sélecteur d'émoji",
"Close_Modal": "Fermer la fenêtre modale",
"Code_or_password_invalid": "Code ou mot de passe invalide",
"Collaborative": "Collaboratif",
"Condensed": "Condensé",
Expand Down
1 change: 0 additions & 1 deletion app/i18n/locales/hi-IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@
"Close": "बंद करें",
"Close_Chat": "चैट बंद करें",
"Close_emoji_selector": "इमोजी चयनकर्ता बंद करें",
"Close_Modal": "मोडल बंद करें।",
"Code_or_password_invalid": "कोड या पासवर्ड अमान्य है",
"Collaborative": "सहयोगी",
"Condensed": "संक्षेपित",
Expand Down
1 change: 0 additions & 1 deletion app/i18n/locales/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@
"Close": "Bezár",
"Close_Chat": "Csevegés lezárása",
"Close_emoji_selector": "Emoji választó bezárása",
"Close_Modal": "Bezárás modalban",
"Code_or_password_invalid": "A kód vagy a jelszó érvénytelen",
"Collaborative": "Együttműködés",
"Condensed": "Rövidített",
Expand Down
1 change: 0 additions & 1 deletion app/i18n/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
"Click_to_join": "Clicca per unirti!",
"Close": "Chiudi",
"Close_emoji_selector": "Chiudi selettore emoji",
"Close_Modal": "Chiudi Modale",
"Code_or_password_invalid": "Codice o password non validi",
"Collaborative": "Collaborativo",
"Confirm": "Conferma",
Expand Down
1 change: 0 additions & 1 deletion app/i18n/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
"Click_to_join": "クリックして参加!",
"Close": "閉じる",
"Close_emoji_selector": "絵文字ピッカーを閉じる",
"Close_Modal": "モーダルを閉じる",
"Code_or_password_invalid": "無効なコードまたはパスワード",
"Collaborative": "コラボ",
"Confirm": "承認",
Expand Down
1 change: 0 additions & 1 deletion app/i18n/locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"Click_to_join": "Klik om mee te doen!",
"Close": "Sluiten",
"Close_emoji_selector": "Emoji-kiezer sluiten",
"Close_Modal": "Sluit venster",
"Code_or_password_invalid": "Code of wachtwoord ongeldig",
"Collaborative": "Samenwerkend",
"Condensed": "Gecondenseerd",
Expand Down
1 change: 0 additions & 1 deletion app/i18n/locales/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@
"Close": "Fechar",
"Close_Chat": "Fechar conversa",
"Close_emoji_selector": "Fechar seletor de emojis",
"Close_Modal": "Fechar Modal",
"Code_or_password_invalid": "Código ou senha inválido",
"Collaborative": "Colaborativo",
"Community_edition_push_quota": "Cota de notificações push community edition",
Expand Down
1 change: 0 additions & 1 deletion app/i18n/locales/pt-PT.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
"Click_to_join": "Clique para Entrar!",
"Close": "Fechar",
"Close_emoji_selector": "Fechar selector de emoticons",
"Close_Modal": "Fechar Modal",
"Code_or_password_invalid": "Código ou senha inválidos",
"Collaborative": "Colaborativa",
"Confirm": "Confirmar",
Expand Down
1 change: 0 additions & 1 deletion app/i18n/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@
"Close": "Закрыть",
"Close_Chat": "Закрыть чат",
"Close_emoji_selector": "Закрыть выбор emoji",
"Close_Modal": "Закрыть окно",
"Code_or_password_invalid": "Код или пароль не верны",
"Collaborative": "Совместный",
"Condensed": "Упрощенный",
Expand Down
1 change: 0 additions & 1 deletion app/i18n/locales/sl-SI.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
"Close": "Zapri",
"Close_Chat": "Zaprite klepet",
"Close_emoji_selector": "Zapri izbirnik čustvenih simbolov",
"Close_Modal": "Zapri modalno okno",
"Code_or_password_invalid": "Koda ali geslo ni veljavno",
"Collaborative": "Sodelovanje",
"Condensed": "Kondenzirano",
Expand Down
1 change: 0 additions & 1 deletion app/i18n/locales/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@
"Close": "Stäng",
"Close_Chat": "Stäng chatt",
"Close_emoji_selector": "Stäng emojiväljaren",
"Close_Modal": "Stäng modal",
"Code_or_password_invalid": "Koden eller lösenordet är ogiltigt",
"Collaborative": "Samarbete",
"Condensed": "Komprimerade",
Expand Down
1 change: 0 additions & 1 deletion app/i18n/locales/ta-IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@
"Close": "மூடு",
"Close_Chat": "உரையாடலை மூடு",
"Close_emoji_selector": "எமோஜி தேர்ந்தெடுக்கும் வழிமுறை மூடு",
"Close_Modal": "மூடுக.",
"Code_or_password_invalid": "குறியீடு அல்லது கடவுச்சொல் தவறானது",
"Collaborative": "ஒருமித்த",
"Condensed": "குறைந்தது",
Expand Down
1 change: 0 additions & 1 deletion app/i18n/locales/te-IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@
"Close": "మూసివేయి",
"Close_Chat": "చాట్‌ను మూసివేయండి",
"Close_emoji_selector": "ఎమోజి ఎంచుకోడానికి మూసివేయి",
"Close_Modal": "मॉडल बंद करें",
"Code_or_password_invalid": "కోడ్ లేదా పాస్‌వర్డ్ చెల్లనిది",
"Collaborative": "సహయోగం",
"Condensed": "సంక్షేపించబడిన",
Expand Down
1 change: 0 additions & 1 deletion app/i18n/locales/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
"Click_to_join": "Katılmak için tıklayın!",
"Close": "Kapat",
"Close_emoji_selector": "Emoji seçiciyi kapat",
"Close_Modal": "Modali Kapat",
"Code_or_password_invalid": "Kod veya şifre geçersiz",
"Collaborative": "İşbirlikçi",
"Confirm": "Onayla",
Expand Down
1 change: 0 additions & 1 deletion app/i18n/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
"Click_to_join": "点击以参与",
"Close": "关闭",
"Close_emoji_selector": "关闭 emoji 选择器",
"Close_Modal": "关闭模态框",
"Code_or_password_invalid": "验证码或密码不正确",
"Collaborative": "协作",
"Confirm": "确认",
Expand Down
1 change: 0 additions & 1 deletion app/i18n/locales/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
"Click_to_join": "點擊以參與",
"Close": "關閉",
"Close_emoji_selector": "關閉 emoji 選擇器",
"Close_Modal": "關閉模式框",
"Code_or_password_invalid": "驗證碼或密碼不正確",
"Collaborative": "協作",
"Confirm": "確認",
Expand Down

0 comments on commit e288fb6

Please sign in to comment.