Compare commits

..
Author SHA1 Message Date
Ibrahem Khalil 786eb44e0d Merge branch 'develop' into 17871 2024-01-30 15:34:10 +02:00
Ibrahem Khalil 1ec57d1536 Merge branch 'develop' into 17871 2024-01-27 17:55:58 +02:00
Ibrkhalil 5296c484e0 Use string to fix test 2024-01-13 15:46:12 +02:00
Ibrkhalil 58be10e7eb Adjust precision 2024-01-13 15:41:20 +02:00
Ibrkhalil fcf2a68549 Use with-precision for token requirements 2024-01-13 14:57:53 +02:00
4 changed files with 33 additions and 56 deletions
@@ -5,47 +5,35 @@
[react-native.core :as rn]
[status-im.common.resources :as resources]
[status-im.contexts.wallet.common.empty-tab.view :as empty-tab]
[utils.i18n :as i18n]
[utils.image-server :as image-server]
[utils.re-frame :as rf]))
(defn- f-view-internal
[{:keys [theme collectibles filtered? on-collectible-press]}]
(fn []
(let [no-results-match-query? (and filtered? (empty? collectibles))
port (rf/sub [:mediaserver/port])]
(cond
no-results-match-query?
[rn/view {:style {:flex 1 :justify-content :center}}
[quo/empty-state
{:title (i18n/label :t/nothing-found)
:description (i18n/label :t/try-to-search-something-else)
:image (resources/get-themed-image :no-collectibles theme)}]]
(empty? collectibles)
[empty-tab/view
{:title (i18n/label :t/no-collectibles)
:description (i18n/label :t/no-collectibles-description)
:image (resources/get-themed-image :no-collectibles theme)}]
:else
[rn/flat-list
{:data collectibles
:style {:flex 1}
:content-container-style {:align-items :center}
:num-columns 2
:render-fn (fn [{:keys [preview-url] :as collectible}]
(let [preview-url (image-server/get-preview-image-for-url
{:url (:uri preview-url)
:size 300
:port port})]
[quo/collectible
{:images [preview-url]
:on-press #(when on-collectible-press
(on-collectible-press collectible))}]))}]))))
[utils.i18n :as i18n]))
(defn- view-internal
[props]
[:f> f-view-internal props])
[{:keys [theme collectibles filtered? on-collectible-press]}]
(let [no-results-match-query? (and filtered? (empty? collectibles))]
(cond
no-results-match-query?
[rn/view {:style {:flex 1 :justify-content :center}}
[quo/empty-state
{:title (i18n/label :t/nothing-found)
:description (i18n/label :t/try-to-search-something-else)
:image (resources/get-themed-image :no-collectibles theme)}]]
(empty? collectibles)
[empty-tab/view
{:title (i18n/label :t/no-collectibles)
:description (i18n/label :t/no-collectibles-description)
:image (resources/get-themed-image :no-collectibles theme)}]
:else
[rn/flat-list
{:data collectibles
:style {:flex 1}
:content-container-style {:align-items :center}
:num-columns 2
:render-fn (fn [{:keys [preview-url] :as collectible}]
[quo/collectible
{:images [preview-url]
:on-press #(when on-collectible-press
(on-collectible-press collectible))}])}])))
(def view (quo.theme/with-theme view-internal))
+2 -1
View File
@@ -4,7 +4,8 @@
[legacy.status-im.ui.screens.profile.visibility-status.utils :as visibility-status-utils]
[re-frame.core :as re-frame]
[status-im.constants :as constants]
[utils.i18n :as i18n]))
[utils.i18n :as i18n]
[utils.money :as money]))
(re-frame/reg-sub
:communities/fetching-community
-12
View File
@@ -10,7 +10,6 @@
(def ^:const account-initials-action "/accountInitials")
(def ^:const contact-images-action "/contactImages")
(def ^:const generate-qr-action "/GenerateQRCode")
(def ^:const image-preview-action "/image-preview")
(defn get-font-file-ready
"setup font file and get the absolute path to it
@@ -295,14 +294,3 @@
"&size="
qr-size)]
media-server-url))
(defn get-preview-image-for-url
[{:keys [url size port]}]
(let [encoded-url (js/encodeURIComponent url)]
(str image-server-uri-prefix
port
image-preview-action
"?image_url="
encoded-url
"&size="
size)))
+3 -3
View File
@@ -3,7 +3,7 @@
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
"owner": "status-im",
"repo": "status-go",
"version": "feat/media-server-image-preview-gen",
"commit-sha1": "26fec07fed62eb430e93a7176768d9f656a33645",
"src-sha256": "0k2iwk2wlrij4bk1jz2yax06fdpl6d3mxls2yhx18p7yqkk901w4"
"version": "v0.172.10",
"commit-sha1": "69948a7024df8c4537fc4986b39aded22e89179b",
"src-sha256": "0xg32k3f4yy7gwqzh60qdgrgi2zvm8s1w7sisqmcn5vw90jya70w"
}