fix: image flicker (#15932)

This commit is contained in:
Omar Basem 2023-05-17 15:52:23 +04:00 committed by GitHub
parent 6598873343
commit 03f501ca7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 13 deletions

View File

@ -18,6 +18,9 @@
(let [insets (safe-area/get-insets) (let [insets (safe-area/get-insets)
dimensions (calculate-dimensions (or image-width 1000) (or image-height 1000)) dimensions (calculate-dimensions (or image-width 1000) (or image-height 1000))
shared-element-id (rf/sub [:shared-element-id])] shared-element-id (rf/sub [:shared-element-id])]
[:<>
(when (= index 0)
[rn/view {:style {:margin-bottom 10}} [text/text-content message context]])
[rn/touchable-opacity [rn/touchable-opacity
{:active-opacity 1 {:active-opacity 1
:style {:margin-top (when (pos? index) 10)} :style {:margin-top (when (pos? index) 10)}
@ -27,9 +30,7 @@
{:messages [message] {:messages [message]
:index 0 :index 0
:insets insets}])} :insets insets}])}
(when (= index 0)
[rn/view {:style {:margin-bottom 10}} [text/text-content message context]])
[fast-image/fast-image [fast-image/fast-image
{:source {:uri (:image content)} {:source {:uri (:image content)}
:style (merge dimensions {:border-radius 12}) :style (merge dimensions {:border-radius 12})
:native-ID (when (= shared-element-id message-id) :shared-element)}]])) :native-ID (when (= shared-element-id message-id) :shared-element)}]]]))