Fix: missing community logo in Activity Center (#17159)

The bug was caused, again, by the fact that the component react-native/image
source was a string and it was not wrapped inside the map {:uri "..."}. The
bug was likely introduced by commit 255a3b9172

I decided to change react-native.image for good, similarly to what we do in
react-native/fast-image
(ebd38295c6/src/react_native/fast_image.cljs (L21))
so we can prevent this type of bug in the future.

Fixes https://github.com/status-im/status-mobile/issues/17157
This commit is contained in:
Icaro Motta 2023-09-01 11:31:19 +00:00 committed by GitHub
parent d35dbff044
commit 1ac7c2f965
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 1 deletions

View File

@ -16,7 +16,17 @@
(def view (reagent/adapt-react-class (.-View ^js react-native)))
(def scroll-view (reagent/adapt-react-class (.-ScrollView ^js react-native)))
(def image (reagent/adapt-react-class (.-Image ^js react-native)))
(def ^:private image-native
(reagent/adapt-react-class (.-Image ^js react-native)))
(defn image
[{:keys [source] :as props}]
[image-native
(if (string? source)
(assoc props :source {:uri source})
props)])
(defn image-get-size [uri callback] (.getSize ^js (.-Image ^js react-native) uri callback))
(def text (reagent/adapt-react-class (.-Text ^js react-native)))
(def text-input (reagent/adapt-react-class (.-TextInput ^js react-native)))