improved reactions a11y

This commit is contained in:
Mauro Romito
2025-06-17 19:54:08 +02:00
committed by Mauro
parent 28038adc0d
commit 12e55d6c28
5 changed files with 53 additions and 10 deletions
@@ -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