diff --git a/src/quo2/components/notifications/toast/view.cljs b/src/quo2/components/notifications/toast/view.cljs index 6056b11a3a..2af9878ab0 100644 --- a/src/quo2/components/notifications/toast/view.cljs +++ b/src/quo2/components/notifications/toast/view.cljs @@ -1,5 +1,6 @@ (ns quo2.components.notifications.toast.view - (:require [quo2.components.icon :as icon] + (:require [quo2.components.avatars.user-avatar.view :as user-avatar] + [quo2.components.icon :as icon] [quo2.components.markdown.text :as text] [quo2.components.notifications.count-down-circle :as count-down-circle] [quo2.components.notifications.toast.style :as style] @@ -60,13 +61,16 @@ (defn toast [{:keys [icon icon-color title text action undo-duration undo-on-press container-style - override-theme]}] + override-theme user]}] [toast-container - {:left (when icon - [icon/icon icon - (cond-> (style/icon override-theme) - icon-color - (assoc :color icon-color))]) + {:left (cond icon + [icon/icon icon + (cond-> (style/icon override-theme) + icon-color + (assoc :color icon-color))] + + user + [user-avatar/user-avatar user]) :title title :text text :right (if undo-duration diff --git a/src/status_im2/contexts/activity_center/events.cljs b/src/status_im2/contexts/activity_center/events.cljs index 86006fade1..7e2af8d33e 100644 --- a/src/status_im2/contexts/activity_center/events.cljs +++ b/src/status_im2/contexts/activity_center/events.cljs @@ -532,29 +532,33 @@ [{:keys [db]} new-notifications] (let [my-public-key (get-in db [:multiaccount :public-key])] (reduce (fn [cofx {:keys [author type accepted dismissed message name] :as x}] - (cond - (and (not= author my-public-key) - (= type types/contact-request) - (not accepted) - (not dismissed)) - (toasts/upsert cofx - {:icon :placeholder - :icon-color colors/primary-50-opa-40 - :title (i18n/label :t/contact-request-sent-toast - {:name name}) - :text (get-in message [:content :text])}) + (let [user-avatar {:full-name name + :status-indicator? true + :online? nil + :size :small + :ring? false}] + (cond + (and (not= author my-public-key) + (= type types/contact-request) + (not accepted) + (not dismissed)) + (toasts/upsert cofx + {:user user-avatar + :icon-color colors/primary-50-opa-40 + :title (i18n/label :t/contact-request-sent-toast + {:name name}) + :text (get-in message [:content :text])}) - (and (= author my-public-key) ;; we show it for user who sent the request - (= type types/contact-request) - accepted - (not dismissed)) - (toasts/upsert cofx - {:icon :placeholder - :icon-color colors/primary-50-opa-40 - :title (i18n/label :t/contact-request-accepted-toast - {:name (or name (:alias message))})}) - - :else - cofx)) + (and (= author my-public-key) ;; we show it for user who sent the request + (= type types/contact-request) + accepted + (not dismissed)) + (toasts/upsert cofx + {:user user-avatar + :icon-color colors/success-50-opa-40 + :title (i18n/label :t/contact-request-accepted-toast + {:name (or name (:alias message))})}) + :else + cofx))) {:db db} new-notifications)))