File tree 3 files changed +26
-6
lines changed
quo2/components/notifications/activity_log
status_im2/contexts/shell/activity_center/notification/reply
3 files changed +26
-6
lines changed Original file line number Diff line number Diff line change 25
25
(def message-body
26
26
{:color colors/white})
27
27
28
- (def message-container
28
+ (defn message-container
29
+ [attachment]
29
30
{:border-radius 12
30
31
:margin-top 12
31
32
:padding-horizontal 12
32
- :padding-vertical 8
33
+ :padding-vertical ( if (#{ :photo :gif } attachment) 12 8 )
33
34
:background-color colors/white-opa-5})
34
35
35
36
(def footer-container
Original file line number Diff line number Diff line change 74
74
context))))
75
75
76
76
(defn- activity-message
77
- [{:keys [title body title-number-of-lines body-number-of-lines]}]
78
- [rn/view {:style style/message-container}
77
+ [{:keys [title body title-number-of-lines body-number-of-lines attachment ]}]
78
+ [rn/view {:style ( style/message-container attachment) }
79
79
(when title
80
80
[text/text
81
81
{:size :paragraph-2
Original file line number Diff line number Diff line change 10
10
[utils.datetime :as datetime]
11
11
[utils.i18n :as i18n]
12
12
[utils.re-frame :as rf]
13
- [status-im2.contexts.chat.messages.content.image.view :as image ]))
13
+ [status-im.utils.http :as http ]))
14
14
15
15
; ; NOTE: Replies support text, image and stickers only.
16
16
(defn- get-message-content
19
19
constants/content-type-text [quo/text {:style style/tag-text}
20
20
(get-in message [:content :text ])]
21
21
22
- constants/content-type-image [image/image-message 0 message nil ]
22
+ constants/content-type-image
23
+ (let [image (get-in message [:content :image ])
24
+ image-local-url (http/replace-port image (rf/sub [:mediaserver/port ]))
25
+ photos (when image-local-url [{:uri image-local-url}])]
26
+ [quo/activity-logs-photos {:photos photos}])
23
27
24
28
constants/content-type-sticker [old-message/sticker message]
25
29
72
76
[quo/context-tag common/tag-params community-image community-name chat-name]
73
77
[quo/group-avatar-tag chat-name common/tag-params])]
74
78
:message {:body-number-of-lines 1
79
+ :attachment (cond
80
+ (= (:content-type message) constants/content-type-text)
81
+ :text
82
+
83
+ (= (:content-type message) constants/content-type-image)
84
+ :photo
85
+
86
+ (= (:content-type message) constants/content-type-sticker)
87
+ :sticker
88
+
89
+ (= (:content-type message) constants/content-type-gif)
90
+ :gif
91
+
92
+ :else
93
+ nil )
75
94
:body (get-message-content message)}}]]]))
You can’t perform that action at this time.
0 commit comments