diff --git a/src/quo2/components/notifications/activity_log/style.cljs b/src/quo2/components/notifications/activity_log/style.cljs index 05f562f8b0..e75cb35935 100644 --- a/src/quo2/components/notifications/activity_log/style.cljs +++ b/src/quo2/components/notifications/activity_log/style.cljs @@ -25,11 +25,12 @@ (def message-body {:color colors/white}) -(def message-container +(defn message-container + [attachment] {:border-radius 12 :margin-top 12 :padding-horizontal 12 - :padding-vertical 8 + :padding-vertical (if (#{:photo :gif} attachment) 12 8) :background-color colors/white-opa-5}) (def footer-container diff --git a/src/quo2/components/notifications/activity_log/view.cljs b/src/quo2/components/notifications/activity_log/view.cljs index dda699dfbf..158ff6d6a7 100644 --- a/src/quo2/components/notifications/activity_log/view.cljs +++ b/src/quo2/components/notifications/activity_log/view.cljs @@ -74,8 +74,8 @@ context)))) (defn- activity-message - [{:keys [title body title-number-of-lines body-number-of-lines]}] - [rn/view {:style style/message-container} + [{:keys [title body title-number-of-lines body-number-of-lines attachment]}] + [rn/view {:style (style/message-container attachment)} (when title [text/text {:size :paragraph-2 diff --git a/src/status_im2/contexts/shell/activity_center/notification/reply/view.cljs b/src/status_im2/contexts/shell/activity_center/notification/reply/view.cljs index 39ca74040d..a7ef54a696 100644 --- a/src/status_im2/contexts/shell/activity_center/notification/reply/view.cljs +++ b/src/status_im2/contexts/shell/activity_center/notification/reply/view.cljs @@ -10,7 +10,7 @@ [utils.datetime :as datetime] [utils.i18n :as i18n] [utils.re-frame :as rf] - [status-im2.contexts.chat.messages.content.image.view :as image])) + [status-im.utils.http :as http])) ;; NOTE: Replies support text, image and stickers only. (defn- get-message-content @@ -19,7 +19,11 @@ constants/content-type-text [quo/text {:style style/tag-text} (get-in message [:content :text])] - constants/content-type-image [image/image-message 0 message nil] + constants/content-type-image + (let [image (get-in message [:content :image]) + image-local-url (http/replace-port image (rf/sub [:mediaserver/port])) + photos (when image-local-url [{:uri image-local-url}])] + [quo/activity-logs-photos {:photos photos}]) constants/content-type-sticker [old-message/sticker message] @@ -72,4 +76,19 @@ [quo/context-tag common/tag-params community-image community-name chat-name] [quo/group-avatar-tag chat-name common/tag-params])] :message {:body-number-of-lines 1 + :attachment (cond + (= (:content-type message) constants/content-type-text) + :text + + (= (:content-type message) constants/content-type-image) + :photo + + (= (:content-type message) constants/content-type-sticker) + :sticker + + (= (:content-type message) constants/content-type-gif) + :gif + + :else + nil) :body (get-message-content message)}}]]]))