Change accessibility label as per online status (#12846)
This commit is contained in:
parent
ae26024890
commit
b4b39e5088
|
@ -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]
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue