Add accessibility to components (#14359)

- chat name text component
- quoted message text component
This commit is contained in:
Parvesh Monu 2022-11-15 16:41:56 +05:30 committed by GitHub
parent 2f4d8accae
commit 1228f4aa26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 13 deletions

View File

@ -80,8 +80,9 @@
(defn display-name-view [display-name contact timestamp]
[rn/view {:style {:flex-direction :row}}
[text/text {:weight :semi-bold
:size :paragraph-1}
[text/text {:weight :semi-bold
:accessibility-label :chat-name-text
:size :paragraph-1}
display-name]
[verified-or-contact-icon contact]
[text/text {:style (style/timestamp)}

View File

@ -63,17 +63,20 @@
:number-of-lines 1
:style {:margin-left 4}}
(format-reply-author from contact-name current-public-key)]
[quo2.text/text {:number-of-lines 1
:size :label
:weight :regular
:style (merge {:ellipsize-mode :tail
:text-transform :none
:margin-left 4
:margin-top 2}
(when (or (= constants/content-type-image content-type)
(= constants/content-type-sticker content-type)
(= constants/content-type-audio content-type))
{:color (colors/theme-colors colors/neutral-50 colors/neutral-40)}))}
[quo2.text/text
{:number-of-lines 1
:size :label
:weight :regular
:accessibility-label :quoted-message
:style (merge
{:ellipsize-mode :tail
:text-transform :none
:margin-left 4
:margin-top 2}
(when (or (= constants/content-type-image content-type)
(= constants/content-type-sticker content-type)
(= constants/content-type-audio content-type))
{:color (colors/theme-colors colors/neutral-50 colors/neutral-40)}))}
(case (or content-type contentType)
constants/content-type-image "Image"
constants/content-type-sticker "Sticker"