Skip to content

Commit

Permalink
fix: updated AvatarWithEdit accessibility label
Browse files Browse the repository at this point in the history
  • Loading branch information
OtavioStasiak committed Dec 13, 2024
1 parent 4a2c93a commit 506052d
Show file tree
Hide file tree
Showing 27 changed files with 49 additions and 12 deletions.
6 changes: 4 additions & 2 deletions app/containers/Avatar/AvatarWithEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const styles = StyleSheet.create({

interface IAvatarContainer extends Omit<IAvatar, 'size'> {
handleEdit?: () => void;
editAccessibilityLabel?: string;
}

const AvatarWithEdit = ({
Expand All @@ -41,7 +42,8 @@ const AvatarWithEdit = ({
getCustomEmoji,
isStatic,
rid,
handleEdit
handleEdit,
editAccessibilityLabel
}: IAvatarContainer): React.ReactElement => {
const { colors } = useTheme();

Expand All @@ -67,7 +69,7 @@ const AvatarWithEdit = ({
/>
{handleEdit && serverVersion && compareServerVersion(serverVersion, 'greaterThanOrEqualTo', '3.6.0') ? (
<Button
accessibilityLabel={I18n.t('Edit_Room_Photo')}
accessibilityLabel={editAccessibilityLabel}
title={I18n.t('Edit')}
type='secondary'
onPress={handleEdit}
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
"E2E_How_It_Works_info3": "حين الاستمرار سيتم إنشاء كلمة المرور بين الطرفيات",
"E2E_How_It_Works_info4": "بإمكانك أيضاً إنشاء كلمة مرور جديدة لمفتاح التشفير في أي وقت عند دخولك بكلمة المرور الحالية لمفتاح التشفير",
"Edit": "تعديل",
"Edit_Avatar": "تعديل الصورة الرمزية",
"Edit_Invite": "تعديل الدعوة",
"Edit_Room_Photo": "تحرير صورة الغرفة",
"Edit_Status": "تعديل الحالة",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/bn-IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@
"E2E_How_It_Works_info3": "আপনি যদি এগিয়ে যান তবে এটি স্বয়ংক্রিয় ভাবে একটি E2E পাসওয়ার্ড জেনারেট হবে।",
"E2E_How_It_Works_info4": "আপনি যে কোনও ব্রাউজার থেকে একটি নতুন পাসওয়ার্ড সেটআপ করতে পারেন আপনার এনক্রিপশন কীর জন্য সময়ের মধ্যে যে কোনও ব্রাউজারে যাতে আপনি বর্তমানের E2E পাসওয়ার্ড দিয়ে এনটার করেছেন।",
"Edit": "সম্পাদনা করুন",
"Edit_Avatar": "অবতার সম্পাদনা করুন",
"Edit_Invite": "ইনভাইট সম্পাদনা করুন",
"Edit_Room_Photo": "রুমের ছবি সম্পাদনা করুন।",
"Edit_Status": "স্থিতি সম্পাদনা করুন",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@
"E2E_How_It_Works_info3": "Pokud budete pokračovat, bude automaticky vygenerováno heslo E2E.",
"E2E_How_It_Works_info4": "Nové heslo pro svůj šifrovací klíč můžete také nastavit kdykoli z libovolného prohlížeče, kde jste zadali stávající heslo E2E.",
"Edit": "Upravit",
"Edit_Avatar": "Upravit avatar",
"Edit_Invite": "Upravit pozvánku",
"Edit_Room_Photo": "Upravit fotografii místnosti",
"Edit_Status": "Upravit stav",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@
"E2E_How_It_Works_info3": "Wenn Sie fortfahren, wird automatisch ein ein E2E-Passwort erzeugt.",
"E2E_How_It_Works_info4": "Sie können außerdem jederzeit, in jedem Browser, in dem Sie das bestehende Passwort eingegeben haben, ein neues Passwort setzen.",
"Edit": "Bearbeiten",
"Edit_Avatar": "Avatar bearbeiten",
"Edit_Invite": "Einladung bearbeiten",
"Edit_Room_Photo": "Fotoraum bearbeiten",
"Edit_Status": "Status ändern",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@
"e2ee_disabled": "End-to-end encryption is disabled",
"e2ee_enabled": "End-to-end encryption is enabled",
"Edit": "Edit",
"Edit_Avatar": "Edit avatar",
"Edit_Invite": "Edit invite",
"Edit_Room_Photo": "Edit room photo",
"Edit_Status": "Edit status",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
"Do_you_really_want_to_key_this_room_question_mark": "¿Deseas {{key}} de esta sala?",
"Dont_Have_An_Account": "¿Todavía no tienes una cuenta?",
"Edit": "Editar",
"Edit_Avatar": "Editar avatar",
"Edit_Room_Photo": "Editar foto de la habitación",
"Email": "E-mail",
"Enable_Auto_Translate": "Permitir Auto-Translate",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@
"E2E_How_It_Works_info3": "Jos jatkat, täyden salauksen salasana luodaan automaattisesti.",
"E2E_How_It_Works_info4": "Voit myös määrittää uuden salasanan salausavaimellesi milloin tahansa missä tahansa selaimessa, jossa olet antanut nykyisen täyden salauksen salasanan.",
"Edit": "Muokkaa",
"Edit_Avatar": "Muokkaa avataria",
"Edit_Invite": "Muokkaa kutsua",
"Edit_Room_Photo": "Muokkaa huonekuvaa",
"Edit_Status": "Muokkaa tilaa",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
"E2E_How_It_Works_info3": "Si vous continuez, un mot de passe E2E sera automatiquement généré.",
"E2E_How_It_Works_info4": "Vous pouvez également configurer un nouveau mot de passe pour votre clé de cryptage à tout moment à partir de n'importe quel navigateur dans lequel vous avez entré le mot de passe E2E existant.",
"Edit": "Modifier",
"Edit_Avatar": "Modifier l'avatar",
"Edit_Invite": "Modifier l'invitation",
"Edit_Room_Photo": "Modifier la photo de la pièce",
"Edit_Status": "Modifier le statut",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/hi-IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@
"E2E_How_It_Works_info3": "यदि आप आगे बढ़ते हैं, तो एक इंड-टू-इंड पासवर्ड स्वच्छता से उत्पन्न हो जाएगा।",
"E2E_How_It_Works_info4": "आप अपने इंड-टू-इंड पासवर्ड से पुनः ब्राउज़र में किसी भी स्थान से कभी भी एक नए पासवर्ड को सेटअप कर सकते हैं।",
"Edit": "संपादित करें",
"Edit_Avatar": "अवतार संपादित करें",
"Edit_Invite": "आमंत्रण संपादित करें",
"Edit_Room_Photo": "कक्ष फोटो संपादित करें",
"Edit_Status": "स्थिति संपादित करें",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@
"E2E_How_It_Works_info3": "Ha folytatja, automatikusan generál egy E2E jelszót.",
"E2E_How_It_Works_info4": "A titkosítási kulcshoz bármikor beállíthat egy új jelszót is, bármelyik böngészőből, ahová a meglévő E2E jelszót beírta.",
"Edit": "Szerkesztés",
"Edit_Avatar": "Avatar szerkesztése",
"Edit_Invite": "Meghívás szerkesztése",
"Edit_Room_Photo": "Szoba fotójának szerkesztése",
"Edit_Status": "Állapot szerkesztése",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
"E2E_How_It_Works_info3": "Procedendo verrà generata automaticamente una password E2E.",
"E2E_How_It_Works_info4": "Puoi impostare una nuova password per la chiave di cifratura in qualsiasi momento da uno dei browser dove hai inserito la password E2E esistente.",
"Edit": "Modifica",
"Edit_Avatar": "Modifica avatar",
"Edit_Invite": "Modifica invito",
"Edit_Room_Photo": "Modifica foto della stanza",
"Edit_Status": "Modifica Stato",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
"E2E_How_It_Works_info3": "処理を進めると、E2Eパスワードが自動生成されます。",
"E2E_How_It_Works_info4": "既存のE2Eパスワードを入力した任意のブラウザから、暗号化キーの新しいパスワードをいつでも設定することもできます。",
"Edit": "編集",
"Edit_Avatar": "アバターを編集",
"Edit_Invite": "編集に招待",
"Edit_Room_Photo": "部屋の写真を編集",
"Edit_Status": "ステータスを編集する",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
"E2E_How_It_Works_info3": "Als je doorgaat, wordt er automatisch een E2E-wachtwoord gegenereerd.",
"E2E_How_It_Works_info4": "Je kan ook op elk moment een nieuw wachtwoord voor uw coderingssleutel instellen vanuit elke browser waarin u het bestaande E2E-wachtwoord hebt ingevoerd.",
"Edit": "Bewerk",
"Edit_Avatar": "Avatar bewerken",
"Edit_Invite": "Bewerk uitnodiging",
"Edit_Room_Photo": "Kamerfoto bewerken",
"Edit_Status": "Status bewerken",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@
"E2E_How_It_Works_info3": "Se você continuar, será gerada automaticamente uma senha E2E.",
"E2E_How_It_Works_info4": "Você também pode configurar uma nova senha para sua chave de criptografia a qualquer momento em qualquer navegador em que tenha inserido a senha E2E existente.",
"Edit": "Editar",
"Edit_Avatar": "Editar avatar",
"Edit_Invite": "Editar convite",
"Edit_Room_Photo": "Editar foto da sala.",
"Edit_Status": "Editar status",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/pt-PT.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
"E2E_How_It_Works_info3": "Se você prosseguir, uma senha E2E será gerada automaticamente.",
"E2E_How_It_Works_info4": "Você também pode configurar uma nova senha para sua chave de criptografia a qualquer momento a partir de qualquer navegador que você tenha inserido a senha existente do E2E.",
"Edit": "Editar",
"Edit_Avatar": "Editar avatar",
"Edit_Invite": "Editar Convite",
"Edit_Room_Photo": "Editar foto da sala",
"Edit_Status": "Editar Status",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@
"E2E_How_It_Works_info3": "В случаем продолжения, пароль Е2Е будет сгенерирован автоматически.",
"E2E_How_It_Works_info4": "Так же Вы можете задать новый пароль для вашего ключа шифрования в любое время при помощи браузера там же, где Вы ввели существующий Е2Е пароль.",
"Edit": "Правка",
"Edit_Avatar": "Редактировать аватар",
"Edit_Invite": "Редактировать Приглашение",
"Edit_Room_Photo": "Отредактировать фото комнаты",
"Edit_Status": "Изменить статус",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/sl-SI.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@
"E2E_How_It_Works_info3": "Če nadaljujete, bo to samodejno ustvarilo geslo E2E.",
"E2E_How_It_Works_info4": "Novo geslo za šifrirni ključ lahko nastavite tudi kadar koli iz katerega koli brskalnika, ki ste ga vnesli obstoječe geslo E2E.",
"Edit": "Uredi",
"Edit_Avatar": "Uredi avatar",
"Edit_Invite": "Uredi povabilo",
"Edit_Room_Photo": "Uredi fotografijo sobe",
"Edit_Status": "Uredi stanje",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@
"E2E_How_It_Works_info3": "Om du fortsätter genereras ett E2E-lösenord automatiskt",
"E2E_How_It_Works_info4": "Du kan när som helst ställa in ett nytt lösenord för krypteringsnyckeln i en webbläsare där du har angett det befintliga E2E-lösenordet.",
"Edit": "Redigera",
"Edit_Avatar": "Redigera avatar",
"Edit_Invite": "Redigera inbjudan",
"Edit_Room_Photo": "Redigera rumsfoto",
"Edit_Status": "Redigera status",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/ta-IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@
"E2E_How_It_Works_info3": "நீங்கள் முன்னேற்றமாக இருந்தால், E2E பாஸ்வேர்ட் தானாக உருவாகும்.",
"E2E_How_It_Works_info4": "நீங்கள் ஏற்கனவே உள்ள E2E பாஸ்வேர்டை உள்ளீடு செய்த உலாவியிலிருந்து எந்த பருவமும் புதிய பாஸ்வேர்டை அமைக்கலாம்.",
"Edit": "திருத்து",
"Edit_Avatar": "அவதாரத்தை திருத்து",
"Edit_Invite": "அழைப்பை திருத்து",
"Edit_Room_Photo": "புகைப்பட அறை திருத்துகை",
"Edit_Status": "நிலையை திருத்து",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/te-IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@
"E2E_How_It_Works_info3": "మీరు ముందు నడుపదిని కొత్తగా ఉంచవచ్చు, అది స్వయంగా ఒక E2E పాస్‌వర్డ్ యాటోమేటిక్‌గా సృష్టించబడుతుంది.",
"E2E_How_It_Works_info4": "మీరు అనుమతి పొందకపోతే, మీరు ప్రస్తుతం ఉపయోగించిన E2E పాస్‌వర్డ్ నుండి ఎంక్రిప్షన్ కీకి కొత్త పాస్‌వర్డ్ సెట్ చేయవచ్చు.",
"Edit": "సవరించు",
"Edit_Avatar": "अवतार संपादित करें",
"Edit_Invite": "ఆహ్వానాన్ని సవరించు",
"Edit_Room_Photo": "कक्ष फोटो संपादित करें",
"Edit_Status": "స్థితిని సవరించు",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
"E2E_How_It_Works_info3": "Devam ederseniz, otomatik olarak bir Uçtan Uca Şifreleme (E2E) şifresi oluşturulacaktır.",
"E2E_How_It_Works_info4": "Mevcut Uçtan Uca Şifreleme (E2E) şifresini, herhangi bir tarayıcıdan istediğiniz zaman girdiğiniz şifreleme anahtarınız için yeni bir şifre de ayarlayabilirsiniz.",
"Edit": "Düzenle",
"Edit_Avatar": "Avatarı düzenle",
"Edit_Invite": "Daveti Düzenle",
"Edit_Room_Photo": "Oda fotoğrafını düzenle",
"Edit_Status": "Durumu Düzenle",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
"E2E_How_It_Works_info3": "如果继续,将自动生成一组 E2E 密码",
"E2E_How_It_Works_info4": "您也可以随时从已输入既有密码的任何浏览器设定新密码给您的加密金钥。",
"Edit": "编辑",
"Edit_Avatar": "编辑头像",
"Edit_Invite": "编辑邀请",
"Edit_Room_Photo": "编辑房间照片",
"Edit_Status": "编辑状态",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
"E2E_How_It_Works_info3": "如果繼續,將自動產生一組 E2E 密碼",
"E2E_How_It_Works_info4": "您也可以隨時從已輸入既有密碼的任何瀏覽器設定新密碼給您的加密金鑰。",
"Edit": "編輯",
"Edit_Avatar": "編輯頭像",
"Edit_Invite": "編輯邀請",
"Edit_Room_Photo": "編輯房間照片",
"Edit_Status": "編輯狀態",
Expand Down
6 changes: 5 additions & 1 deletion app/views/ProfileView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,11 @@ const ProfileView = ({ navigation }: IProfileViewProps): React.ReactElement => {
testID='profile-view-list'
{...scrollPersistTaps}>
<View style={styles.avatarContainer} testID='profile-view-avatar'>
<AvatarWithEdit text={user.username} handleEdit={Accounts_AllowUserAvatarChange ? handleEditAvatar : undefined} />
<AvatarWithEdit
editAccessibilityLabel={I18n.t('Edit_Avatar')}
text={user.username}
handleEdit={Accounts_AllowUserAvatarChange ? handleEditAvatar : undefined}
/>
</View>
<View style={styles.inputs}>
<ControlledFormTextInput
Expand Down
24 changes: 15 additions & 9 deletions app/views/RoomInfoEditView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -524,16 +524,22 @@ class RoomInfoEditView extends React.Component<IRoomInfoEditViewProps, IRoomInfo
style={{ backgroundColor: themes[theme].surfaceRoom }}
contentContainerStyle={sharedStyles.container}
keyboardVerticalOffset={128}
>
>
<StatusBar />
<SafeAreaView testID='room-info-edit-view' style={{ backgroundColor: themes[theme].surfaceRoom }}>
<ScrollView
contentContainerStyle={sharedStyles.containerScrollView}
testID='room-info-edit-view-list'
{...scrollPersistTaps}
>
>
<View style={styles.avatarContainer}>
<AvatarWithEdit type={room.t} text={room.name} rid={room.rid} handleEdit={this.handleEditAvatar} />
<AvatarWithEdit
editAccessibilityLabel={I18n.t('Edit_Room_Photo')}
type={room.t}
text={room.name}
rid={room.rid}
handleEdit={this.handleEditAvatar}
/>
</View>
<FormTextInput
inputRef={e => {
Expand Down Expand Up @@ -666,7 +672,7 @@ class RoomInfoEditView extends React.Component<IRoomInfoEditViewProps, IRoomInfo
onValueChange={this.toggleHideSystemMessages}
labelContainerStyle={styles.hideSystemMessages}
leftLabelStyle={styles.systemMessagesLabel}
>
>
{this.renderSystemMessages()}
</SwitchContainer>
) : null}
Expand All @@ -692,7 +698,7 @@ class RoomInfoEditView extends React.Component<IRoomInfoEditViewProps, IRoomInfo
onPress={this.submit}
disabled={!this.formIsChanged()}
testID='room-info-edit-view-submit'
>
>
<Text style={[styles.button, { color: themes[theme].fontWhite }]} accessibilityRole='button'>
{I18n.t('SAVE')}
</Text>
Expand All @@ -708,11 +714,11 @@ class RoomInfoEditView extends React.Component<IRoomInfoEditViewProps, IRoomInfo
onPress={this.reset}
disabled={!this.formIsChanged()}
testID='room-info-edit-view-reset'
>
>
<Text
style={[styles.button, styles.button_inverted, { color: themes[theme].fontDefault }]}
accessibilityRole='button'
>
>
{I18n.t('RESET')}
</Text>
</TouchableOpacity>
Expand All @@ -728,7 +734,7 @@ class RoomInfoEditView extends React.Component<IRoomInfoEditViewProps, IRoomInfo
onPress={this.toggleArchive}
disabled={archived ? !permissions['unarchive-room'] : !permissions['archive-room']}
testID={archived ? 'room-info-edit-view-unarchive' : 'room-info-edit-view-archive'}
>
>
<Text style={[styles.button, styles.button_inverted, { color: fontDanger }]}>
{archived ? I18n.t('UNARCHIVE') : I18n.t('ARCHIVE')}
</Text>
Expand All @@ -746,7 +752,7 @@ class RoomInfoEditView extends React.Component<IRoomInfoEditViewProps, IRoomInfo
onPress={room.teamMain ? this.deleteTeam : this.delete}
disabled={!this.hasDeletePermission()}
testID='room-info-edit-view-delete'
>
>
<Text style={[styles.button, styles.button_inverted, { color: fontDanger }]} accessibilityRole='button'>
{I18n.t('DELETE')}
</Text>
Expand Down
2 changes: 2 additions & 0 deletions app/views/RoomInfoView/components/RoomInfoViewAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { SubscriptionType } from '../../../definitions';
import { useTheme } from '../../../theme';
import sharedStyles from '../../Styles';
import styles from '../styles';
import I18n from '../../../i18n';

const RoomInfoViewAvatar = ({
showEdit,
Expand All @@ -33,6 +34,7 @@ const RoomInfoViewAvatar = ({
style={styles.avatar}
type={type}
rid={rid}
editAccessibilityLabel={I18n.t('Edit_Room_Photo')}
handleEdit={showAvatarEdit ? handleEditAvatar : undefined}>
{type === SubscriptionType.DIRECT && userId ? (
<View style={[sharedStyles.status, { backgroundColor: colors.surfaceHover }]}>
Expand Down

0 comments on commit 506052d

Please sign in to comment.