chore: add accessiblity ids to message status views

Signed-off-by: Brian Sztamfater <brian@status.im>
This commit is contained in:
Brian Sztamfater 2023-02-08 12:32:48 -03:00
parent cc348fda99
commit 8cfc6ecb4f
No known key found for this signature in database
GPG Key ID: 59EB921E0706B48F
2 changed files with 21 additions and 16 deletions

View File

@ -7,7 +7,9 @@
(defn status (defn status
[outgoing-status] [outgoing-status]
[rn/view {:style style/status-container} [rn/view
{:accessibility-label :message-status
:style style/status-container}
[quo/icon [quo/icon
(if (= outgoing-status :delivered) (if (= outgoing-status :delivered)
:i/delivered :i/delivered

View File

@ -99,21 +99,24 @@
context (assoc context :on-long-press #(message-on-long-press message-data context)) context (assoc context :on-long-press #(message-on-long-press message-data context))
response-to (:response-to content)] response-to (:response-to content)]
[rn/touchable-highlight [rn/touchable-highlight
{:underlay-color (colors/theme-colors colors/neutral-5 colors/neutral-90) {:accessibility-label (if (and outgoing (= outgoing-status :sending))
:style {:border-radius 16 :message-sending
:opacity (if (and outgoing (= outgoing-status :sending)) 0.5 1)} :message-sent)
:on-press (fn [] :underlay-color (colors/theme-colors colors/neutral-5 colors/neutral-90)
(when (and outgoing :style {:border-radius 16
(not (= outgoing-status :sending)) :opacity (if (and outgoing (= outgoing-status :sending)) 0.5 1)}
(not @show-delivery-state?)) :on-press (fn []
(reset! show-delivery-state? true) (when (and outgoing
(js/setTimeout #(reset! show-delivery-state? false) (not (= outgoing-status :sending))
delivery-state-showing-time-ms))) (not @show-delivery-state?))
:on-long-press (fn [] (reset! show-delivery-state? true)
(rf/dispatch [:dismiss-keyboard]) (js/setTimeout #(reset! show-delivery-state? false)
(rf/dispatch [:bottom-sheet/show-sheet delivery-state-showing-time-ms)))
{:content (drawers/reactions-and-actions message-data :on-long-press (fn []
context)}]))} (rf/dispatch [:dismiss-keyboard])
(rf/dispatch [:bottom-sheet/show-sheet
{:content (drawers/reactions-and-actions message-data
context)}]))}
[rn/view {:style {:padding-vertical 8}} [rn/view {:style {:padding-vertical 8}}
(when (and (seq response-to) quoted-message) (when (and (seq response-to) quoted-message)
[old-message/quoted-message {:message-id response-to :chat-id chat-id} quoted-message]) [old-message/quoted-message {:message-id response-to :chat-id chat-id} quoted-message])