mirror of
https://github.com/status-im/status-react.git
synced 2025-02-19 22:28:40 +00:00
Fix UI freezing when image is opened from activity center (#16707)
This commit is contained in:
parent
238e35a281
commit
7cd9f76043
@ -25,11 +25,12 @@
|
|||||||
(def message-body
|
(def message-body
|
||||||
{:color colors/white})
|
{:color colors/white})
|
||||||
|
|
||||||
(def message-container
|
(defn message-container
|
||||||
|
[attachment]
|
||||||
{:border-radius 12
|
{:border-radius 12
|
||||||
:margin-top 12
|
:margin-top 12
|
||||||
:padding-horizontal 12
|
:padding-horizontal 12
|
||||||
:padding-vertical 8
|
:padding-vertical (if (#{:photo :gif} attachment) 12 8)
|
||||||
:background-color colors/white-opa-5})
|
:background-color colors/white-opa-5})
|
||||||
|
|
||||||
(def footer-container
|
(def footer-container
|
||||||
|
@ -74,8 +74,8 @@
|
|||||||
context))))
|
context))))
|
||||||
|
|
||||||
(defn- activity-message
|
(defn- activity-message
|
||||||
[{:keys [title body title-number-of-lines body-number-of-lines]}]
|
[{:keys [title body title-number-of-lines body-number-of-lines attachment]}]
|
||||||
[rn/view {:style style/message-container}
|
[rn/view {:style (style/message-container attachment)}
|
||||||
(when title
|
(when title
|
||||||
[text/text
|
[text/text
|
||||||
{:size :paragraph-2
|
{:size :paragraph-2
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
[utils.datetime :as datetime]
|
[utils.datetime :as datetime]
|
||||||
[utils.i18n :as i18n]
|
[utils.i18n :as i18n]
|
||||||
[utils.re-frame :as rf]
|
[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.
|
;; NOTE: Replies support text, image and stickers only.
|
||||||
(defn- get-message-content
|
(defn- get-message-content
|
||||||
@ -19,7 +19,11 @@
|
|||||||
constants/content-type-text [quo/text {:style style/tag-text}
|
constants/content-type-text [quo/text {:style style/tag-text}
|
||||||
(get-in message [:content :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]
|
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/context-tag common/tag-params community-image community-name chat-name]
|
||||||
[quo/group-avatar-tag chat-name common/tag-params])]
|
[quo/group-avatar-tag chat-name common/tag-params])]
|
||||||
:message {:body-number-of-lines 1
|
: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)}}]]]))
|
:body (get-message-content message)}}]]]))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user