Skip to content

Commit 10495d8

Browse files
committed
[#15210] Show user avatar in contact request toast
1 parent 8121257 commit 10495d8

File tree

2 files changed

+20
-13
lines changed

2 files changed

+20
-13
lines changed

src/quo2/components/notifications/toast.cljs

+12-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
(ns quo2.components.notifications.toast
2-
(:require [quo2.components.icon :as icon]
2+
(:require [quo2.components.avatars.user-avatar :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.foundations.colors :as colors]
@@ -104,15 +105,17 @@
104105

105106
(defn toast
106107
[{:keys [icon icon-color title text action undo-duration undo-on-press container-style
107-
override-theme]}]
108+
override-theme user]}]
108109
[toast-container
109-
{:left (when icon
110-
[icon/icon icon
111-
{:container-style {:width 20 :height 20}
112-
:color (or icon-color
113-
(get-in themes
114-
[:icon (or override-theme (theme/get-theme))
115-
:color]))}])
110+
{:left (cond icon
111+
[icon/icon icon
112+
{:container-style {:width 20 :height 20}
113+
:color (or icon-color
114+
(get-in themes
115+
[:icon (or override-theme (theme/get-theme))
116+
:color]))}]
117+
user
118+
[user-avatar/user-avatar user])
116119
:title title
117120
:text text
118121
:right (if undo-duration

src/status_im2/contexts/activity_center/events.cljs

+8-4
Original file line numberDiff line numberDiff line change
@@ -499,11 +499,15 @@
499499
accepted
500500
(not dismissed))
501501
(toasts/upsert cofx
502-
{:icon :placeholder
503-
:icon-color colors/primary-50-opa-40
502+
{:user {:full-name name
503+
:profile-picture (:identicon message)
504+
:status-indicator? true
505+
:online? nil
506+
:size :small
507+
:ring? false}
508+
:icon-color colors/success-50-opa-40
504509
:title (i18n/label :t/contact-request-accepted-toast
505-
{:name (:alias message)})})
506-
510+
{:name name})})
507511
:else
508512
cofx))
509513
{:db db}

0 commit comments

Comments
 (0)