mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
improved reactions a11y
This commit is contained in:
@@ -36,6 +36,7 @@ struct EmojiPickerScreen: View {
|
||||
.background(Circle()
|
||||
.foregroundColor(emojiBackgroundColor(for: emoji.value)))
|
||||
}
|
||||
.accessibilityLabel(accessibilityLabel(for: emoji.value))
|
||||
}
|
||||
} header: {
|
||||
EmojiPickerScreenHeaderView(title: category.name)
|
||||
@@ -62,6 +63,14 @@ struct EmojiPickerScreen: View {
|
||||
}
|
||||
}
|
||||
|
||||
private func accessibilityLabel(for emoji: String) -> String {
|
||||
if selectedEmojis.contains(emoji) {
|
||||
return L10n.a11yRemoveReaction(emoji)
|
||||
} else {
|
||||
return L10n.a11yAddReaction(emoji)
|
||||
}
|
||||
}
|
||||
|
||||
private func emojiBackgroundColor(for emoji: String) -> Color {
|
||||
if selectedEmojis.contains(emoji) {
|
||||
return .compound.bgActionPrimaryRest
|
||||
|
||||
Reference in New Issue
Block a user