Skip to content

Commit 3d2c4f2

Browse files
committed
[#15210] Show user avatar in contact request toast
1 parent 7f00f96 commit 3d2c4f2

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

src/quo2/components/notifications/toast/view.cljs

+11-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
(ns quo2.components.notifications.toast.view
2-
(:require [quo2.components.icon :as icon]
2+
(:require [quo2.components.avatars.user-avatar.view :as user-avatar]
3+
[quo2.components.icon :as icon]
34
[quo2.components.markdown.text :as text]
45
[quo2.components.notifications.count-down-circle :as count-down-circle]
56
[quo2.components.notifications.toast.style :as style]
@@ -60,13 +61,16 @@
6061

6162
(defn toast
6263
[{:keys [icon icon-color title text action undo-duration undo-on-press container-style
63-
override-theme]}]
64+
override-theme user]}]
6465
[toast-container
65-
{:left (when icon
66-
[icon/icon icon
67-
(cond-> (style/icon override-theme)
68-
icon-color
69-
(assoc :color icon-color))])
66+
{:left (cond icon
67+
[icon/icon icon
68+
(cond-> (style/icon override-theme)
69+
icon-color
70+
(assoc :color icon-color))]
71+
72+
user
73+
[user-avatar/user-avatar user])
7074
:title title
7175
:text text
7276
:right (if undo-duration

src/status_im2/contexts/activity_center/events.cljs

+9-4
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,14 @@
538538
(not accepted)
539539
(not dismissed))
540540
(toasts/upsert cofx
541-
{:icon :placeholder
541+
{:user (cond-> {:full-name name
542+
:status-indicator? true
543+
:online? nil
544+
:size :small
545+
:ring? false}
546+
547+
(:profile-picture message)
548+
(assoc :identicon (:identicon message)))
542549
:icon-color colors/primary-50-opa-40
543550
:title (i18n/label :t/contact-request-sent-toast
544551
{:name name})
@@ -549,11 +556,9 @@
549556
accepted
550557
(not dismissed))
551558
(toasts/upsert cofx
552-
{:icon :placeholder
553-
:icon-color colors/primary-50-opa-40
559+
{:icon-color colors/success-50-opa-40
554560
:title (i18n/label :t/contact-request-accepted-toast
555561
{:name (or name (:alias message))})})
556-
557562
:else
558563
cofx))
559564
{:db db}

0 commit comments

Comments
 (0)