From 8cfc6ecb4f7b719ca880a21c4c921027a12a258e Mon Sep 17 00:00:00 2001 From: Brian Sztamfater Date: Wed, 8 Feb 2023 12:32:48 -0300 Subject: [PATCH] chore: add accessiblity ids to message status views Signed-off-by: Brian Sztamfater --- .../chat/messages/content/status/view.cljs | 4 ++- .../contexts/chat/messages/content/view.cljs | 33 ++++++++++--------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/src/status_im2/contexts/chat/messages/content/status/view.cljs b/src/status_im2/contexts/chat/messages/content/status/view.cljs index 39f5bda3ab..5a77f77975 100644 --- a/src/status_im2/contexts/chat/messages/content/status/view.cljs +++ b/src/status_im2/contexts/chat/messages/content/status/view.cljs @@ -7,7 +7,9 @@ (defn status [outgoing-status] - [rn/view {:style style/status-container} + [rn/view + {:accessibility-label :message-status + :style style/status-container} [quo/icon (if (= outgoing-status :delivered) :i/delivered diff --git a/src/status_im2/contexts/chat/messages/content/view.cljs b/src/status_im2/contexts/chat/messages/content/view.cljs index 7ccb982c69..f5ea43041c 100644 --- a/src/status_im2/contexts/chat/messages/content/view.cljs +++ b/src/status_im2/contexts/chat/messages/content/view.cljs @@ -99,21 +99,24 @@ context (assoc context :on-long-press #(message-on-long-press message-data context)) response-to (:response-to content)] [rn/touchable-highlight - {:underlay-color (colors/theme-colors colors/neutral-5 colors/neutral-90) - :style {:border-radius 16 - :opacity (if (and outgoing (= outgoing-status :sending)) 0.5 1)} - :on-press (fn [] - (when (and outgoing - (not (= outgoing-status :sending)) - (not @show-delivery-state?)) - (reset! show-delivery-state? true) - (js/setTimeout #(reset! show-delivery-state? false) - delivery-state-showing-time-ms))) - :on-long-press (fn [] - (rf/dispatch [:dismiss-keyboard]) - (rf/dispatch [:bottom-sheet/show-sheet - {:content (drawers/reactions-and-actions message-data - context)}]))} + {:accessibility-label (if (and outgoing (= outgoing-status :sending)) + :message-sending + :message-sent) + :underlay-color (colors/theme-colors colors/neutral-5 colors/neutral-90) + :style {:border-radius 16 + :opacity (if (and outgoing (= outgoing-status :sending)) 0.5 1)} + :on-press (fn [] + (when (and outgoing + (not (= outgoing-status :sending)) + (not @show-delivery-state?)) + (reset! show-delivery-state? true) + (js/setTimeout #(reset! show-delivery-state? false) + delivery-state-showing-time-ms))) + :on-long-press (fn [] + (rf/dispatch [:dismiss-keyboard]) + (rf/dispatch [:bottom-sheet/show-sheet + {:content (drawers/reactions-and-actions message-data + context)}]))} [rn/view {:style {:padding-vertical 8}} (when (and (seq response-to) quoted-message) [old-message/quoted-message {:message-id response-to :chat-id chat-id} quoted-message])