Skip to content

Commit

Permalink
Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrkhalil committed Sep 22, 2023
1 parent 88da59b commit ab63478
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
10 changes: 5 additions & 5 deletions src/quo2/components/notifications/activity_logs_photos/view.cljs
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
(ns quo2.components.notifications.activity-logs-photos.view
(:require [react-native.core :as rn]
[quo2.components.markdown.text :as quo2.text]
[quo2.components.markdown.text :as text]
[quo2.components.notifications.activity-logs-photos.style :as style]))

(defn view
[{:keys [photos text]}]
[{:keys [photos message-text]}]
[:<>
(when (seq text)
[quo2.text/text
(when (seq message-text)
[text/text
{:size :paragraph-1
:weight :regular
:style style/text
:number-of-lines 2
:accessibility-label :activity-log-title}
text])
message-text])
[rn/view {:style style/photos-container}
(map-indexed
(fn [index photo]
Expand Down
3 changes: 2 additions & 1 deletion src/status_im/data_store/activities.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
:chatId :chat-id
:contactVerificationStatus :contact-verification-status
:communityId :community-id
:membershipStatus :membership-status})
:membershipStatus :membership-status
:albumMessages :album-messages})
(update :last-message #(when % (messages/<-rpc %)))
(update :message #(when % (messages/<-rpc %)))
(update :reply-message #(when % (messages/<-rpc %)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,22 @@

;; NOTE: Replies support text, image and stickers only.
(defn- get-message-content
[{:keys [content-type] :as message} albumMessages]
[{:keys [content-type] :as message} album-messages]
(case content-type
constants/content-type-text [quo/text {:style style/tag-text}
(get-in message [:content :text])]

constants/content-type-image
(let [images (or albumMessages message)
image-urls (if albumMessages
(let [images (or album-messages message)
image-urls (if album-messages
(mapv #(get % :image) images)
[(get-in message [:content :image])])
image-local-urls (mapv (fn [url]
{:uri (url/replace-port url (rf/sub [:mediaserver/port]))})
image-urls)
photos (when image-local-urls image-local-urls)]
image-urls)]
[quo/activity-logs-photos
{:photos photos
:text (get-in message [:content :text])}])
{:photos image-local-urls
:message-text (get-in message [:content :text])}])

constants/content-type-sticker [old-message/sticker message]

Expand Down Expand Up @@ -61,11 +60,11 @@
(defn view
[{:keys [notification set-swipeable-height customization-color] :as props}]
(let [{:keys [author chat-name community-id chat-id
message read timestamp albumMessages]} notification
community-chat? (not (string/blank? community-id))
community (rf/sub [:communities/community community-id])
community-name (:name community)
community-image (get-in community [:images :thumbnail :uri])]
message read timestamp album-messages]} notification
community-chat? (not (string/blank? community-id))
community (rf/sub [:communities/community community-id])
community-name (:name community)
community-image (get-in community [:images :thumbnail :uri])]
[swipeable props
[gesture/touchable-without-feedback
{:on-press (fn []
Expand Down Expand Up @@ -113,4 +112,4 @@

:else
nil)
:body (get-message-content message albumMessages)}}]]]))
:body (get-message-content message album-messages)}}]]]))

0 comments on commit ab63478

Please sign in to comment.