From b4b39e5088acda444d0a5200afde3e73d5e4d991 Mon Sep 17 00:00:00 2001 From: Parvesh Monu Date: Thu, 25 Nov 2021 18:07:47 +0530 Subject: [PATCH] Change accessibility label as per online status (#12846) --- .../ui/components/chat_icon/screen.cljs | 21 ++++++++++--------- .../profile/visibility_status/utils.cljs | 12 +++++++---- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/status_im/ui/components/chat_icon/screen.cljs b/src/status_im/ui/components/chat_icon/screen.cljs index e0f9c327e5..4b6b7d0a95 100644 --- a/src/status_im/ui/components/chat_icon/screen.cljs +++ b/src/status_im/ui/components/chat_icon/screen.cljs @@ -46,21 +46,22 @@ (defn profile-photo-plus-dot-view [{:keys [public-key photo-container photo-path community?]}] - (let [photo-path (if (nil? photo-path) - @(re-frame.core/subscribe [:chats/photo-path public-key]) - photo-path) - photo-container (if (nil? photo-container) - styles/container-chat-list photo-container) - size (:width photo-container) - identicon? (when photo-path (profile.db/base64-png? photo-path)) - dot-styles (visibility-status-utils/icon-visibility-status-dot - public-key size identicon?)] + (let [photo-path (if (nil? photo-path) + @(re-frame.core/subscribe [:chats/photo-path public-key]) + photo-path) + photo-container (if (nil? photo-container) + styles/container-chat-list photo-container) + size (:width photo-container) + identicon? (when photo-path (profile.db/base64-png? photo-path)) + dot-styles (visibility-status-utils/icon-visibility-status-dot + public-key size identicon?) + dot-accessibility-label (:accessibility-label dot-styles)] [react/view {:style photo-container :accessibility-label :profile-photo} [photos/photo photo-path {:size size}] (when-not community? [react/view {:style dot-styles - :accessibility-label :profile-photo-dot}])])) + :accessibility-label dot-accessibility-label}])])) (defn emoji-chat-icon-view [chat-id group-chat name emoji styles] diff --git a/src/status_im/ui/screens/profile/visibility_status/utils.cljs b/src/status_im/ui/screens/profile/visibility_status/utils.cljs index a06c2f354c..db1abbc79e 100644 --- a/src/status_im/ui/screens/profile/visibility_status/utils.cljs +++ b/src/status_im/ui/screens/profile/visibility_status/utils.cljs @@ -82,11 +82,15 @@ visibility-status-update (visibility-status-update public-key my-icon?) size (/ container-size 4) margin (if identicon? (/ size 6) (/ size 7)) - dot-color (dot-color visibility-status-update my-icon?)] + dot-color (dot-color visibility-status-update my-icon?) + accessibility-label (if (= dot-color colors/color-online) + :online-profile-photo-dot + :offline-profile-photo-dot)] (merge (styles/visibility-status-dot dot-color size) - {:bottom margin - :right margin - :position :absolute}))) + {:bottom margin + :right margin + :position :absolute + :accessibility-label accessibility-label}))) (defn visibility-status-order [public-key] (let [my-icon? (my-icon? public-key)