From 03f501ca7b406b5a8232d7b36c18640959b56f7f Mon Sep 17 00:00:00 2001 From: Omar Basem Date: Wed, 17 May 2023 15:52:23 +0400 Subject: [PATCH] fix: image flicker (#15932) --- .../chat/messages/content/image/view.cljs | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/status_im2/contexts/chat/messages/content/image/view.cljs b/src/status_im2/contexts/chat/messages/content/image/view.cljs index 826f0f351d..a1e5e28c27 100644 --- a/src/status_im2/contexts/chat/messages/content/image/view.cljs +++ b/src/status_im2/contexts/chat/messages/content/image/view.cljs @@ -18,18 +18,19 @@ (let [insets (safe-area/get-insets) dimensions (calculate-dimensions (or image-width 1000) (or image-height 1000)) shared-element-id (rf/sub [:shared-element-id])] - [rn/touchable-opacity - {:active-opacity 1 - :style {:margin-top (when (pos? index) 10)} - :on-long-press on-long-press - :on-press #(rf/dispatch [:chat.ui/navigate-to-lightbox - message-id - {:messages [message] - :index 0 - :insets insets}])} + [:<> (when (= index 0) [rn/view {:style {:margin-bottom 10}} [text/text-content message context]]) - [fast-image/fast-image - {:source {:uri (:image content)} - :style (merge dimensions {:border-radius 12}) - :native-ID (when (= shared-element-id message-id) :shared-element)}]])) + [rn/touchable-opacity + {:active-opacity 1 + :style {:margin-top (when (pos? index) 10)} + :on-long-press on-long-press + :on-press #(rf/dispatch [:chat.ui/navigate-to-lightbox + message-id + {:messages [message] + :index 0 + :insets insets}])} + [fast-image/fast-image + {:source {:uri (:image content)} + :style (merge dimensions {:border-radius 12}) + :native-ID (when (= shared-element-id message-id) :shared-element)}]]]))