From 1ac7c2f965a9824e3b918835c6abfcc19414bfbe Mon Sep 17 00:00:00 2001 From: Icaro Motta Date: Fri, 1 Sep 2023 11:31:19 +0000 Subject: [PATCH] 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 255a3b917265d381fed57e26422277b4cc8772e4 I decided to change react-native.image for good, similarly to what we do in react-native/fast-image (https://github.com/status-im/status-mobile/blob/ebd38295c6e5715a0ee04217b248ac69f9ddceab/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 --- src/react_native/core.cljs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/react_native/core.cljs b/src/react_native/core.cljs index a7d6677e0b..940422a901 100644 --- a/src/react_native/core.cljs +++ b/src/react_native/core.cljs @@ -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)))