Add accessibility labels to mentions (#14667)
This commit is contained in:
parent
5493d059b9
commit
13e59635c7
|
@ -11,32 +11,31 @@
|
||||||
(defn mention-item
|
(defn mention-item
|
||||||
[[public-key {:keys [alias name nickname] :as user}] _ _ text-input-ref]
|
[[public-key {:keys [alias name nickname] :as user}] _ _ text-input-ref]
|
||||||
(let [ens-name? (not= alias name)]
|
(let [ens-name? (not= alias name)]
|
||||||
[rn/touchable-opacity {:on-press #(rf/dispatch [:chat.ui/select-mention text-input-ref user])}
|
[rn/touchable-opacity
|
||||||
|
{:on-press #(rf/dispatch [:chat.ui/select-mention text-input-ref user])
|
||||||
|
:accessibility-label :mention-item}
|
||||||
;;TODO quo2 item should be used
|
;;TODO quo2 item should be used
|
||||||
[list-item/list-item
|
[list-item/list-item
|
||||||
(cond->
|
(cond->
|
||||||
{:icon [photos/member-photo public-key]
|
{:icon [photos/member-photo public-key]
|
||||||
:size :small
|
:size :small
|
||||||
:text-size :small
|
:text-size :small
|
||||||
:title
|
:title [text/text
|
||||||
[text/text
|
{:weight :medium
|
||||||
{:weight :medium
|
:ellipsize-mode :tail
|
||||||
:ellipsize-mode :tail
|
:number-of-lines 1
|
||||||
:number-of-lines 1
|
:size :small}
|
||||||
:size :small}
|
(or nickname name)
|
||||||
(if nickname
|
(when nickname
|
||||||
nickname
|
[text/text
|
||||||
name)
|
{:weight :regular
|
||||||
(when nickname
|
:color :secondary
|
||||||
[text/text
|
:ellipsize-mode :tail
|
||||||
{:weight :regular
|
:size :small}
|
||||||
:color :secondary
|
" "
|
||||||
:ellipsize-mode :tail
|
(when ens-name?
|
||||||
:size :small}
|
"@")
|
||||||
" "
|
name])]
|
||||||
(when ens-name?
|
|
||||||
"@")
|
|
||||||
name])]
|
|
||||||
:title-text-weight :medium}
|
:title-text-weight :medium}
|
||||||
ens-name?
|
ens-name?
|
||||||
(assoc :subtitle alias))]]))
|
(assoc :subtitle alias))]]))
|
||||||
|
@ -58,4 +57,5 @@
|
||||||
:key-fn first
|
:key-fn first
|
||||||
:render-fn mention-item
|
:render-fn mention-item
|
||||||
:render-data text-input-ref
|
:render-data text-input-ref
|
||||||
:content-container-style {:padding-bottom 12}}]]))])
|
:content-container-style {:padding-bottom 12}
|
||||||
|
:accessibility-label :mentions-list}]]))])
|
||||||
|
|
Loading…
Reference in New Issue