Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
47cc8a5757 | ||
|
|
eda9464b6c |
@@ -4,6 +4,7 @@
|
||||
[quo.core :as quo]
|
||||
[react-native.core :as rn]
|
||||
[react-native.reanimated :as reanimated]
|
||||
[react-native.safe-area :as safe-area]
|
||||
[reagent.core :as reagent]
|
||||
[status-im.common.scroll-page.style :as style]
|
||||
[utils.re-frame :as rf]))
|
||||
@@ -59,7 +60,7 @@
|
||||
[rn/view {:style {:margin-top 0}}
|
||||
top-nav]
|
||||
[quo/page-nav
|
||||
(cond-> {:margin-top 44
|
||||
(cond-> {:margin-top (safe-area/get-top)
|
||||
:type :no-title
|
||||
:background (if (= 1 (reanimated/get-shared-value opacity-animation))
|
||||
:blur
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
(ns status-im.contexts.communities.discover.style
|
||||
(:require
|
||||
[react-native.platform :as platform]
|
||||
[status-im.contexts.shell.jump-to.constants :as jump-to.constants]))
|
||||
|
||||
(def screen-title-container
|
||||
{:height 56
|
||||
(def header-height 56)
|
||||
|
||||
(defn screen-title-container
|
||||
[safe-area-top]
|
||||
{:height header-height
|
||||
:padding-vertical 12
|
||||
:justify-content :center
|
||||
:margin-horizontal 20})
|
||||
:margin-horizontal 20
|
||||
:margin-top (+ header-height safe-area-top)})
|
||||
|
||||
(def featured-communities-header
|
||||
{:flex-direction :row
|
||||
@@ -40,7 +43,7 @@
|
||||
[fixed?]
|
||||
(merge
|
||||
{:padding-vertical 12
|
||||
:height 56
|
||||
:height header-height
|
||||
:background-color :transparent}
|
||||
(when-not fixed?
|
||||
{:margin-top 12
|
||||
@@ -60,15 +63,12 @@
|
||||
{:align-items :center
|
||||
:justify-content :center})
|
||||
|
||||
(def render-communities-container
|
||||
{:margin-top (if platform/ios? 57 104)})
|
||||
|
||||
(defn blur-tabs-header
|
||||
[]
|
||||
[safe-area-top]
|
||||
{:padding-horizontal 20
|
||||
:position :absolute
|
||||
:top (if platform/ios? 100 104)
|
||||
:height 56
|
||||
:top (+ header-height safe-area-top)
|
||||
:height header-height
|
||||
:right 0
|
||||
:left 0
|
||||
:justify-content :center
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
[quo.foundations.colors :as colors]
|
||||
[quo.theme :as quo.theme]
|
||||
[react-native.core :as rn]
|
||||
[react-native.safe-area :as safe-area]
|
||||
[reagent.core :as reagent]
|
||||
[status-im.common.scroll-page.view :as scroll-page]
|
||||
[status-im.contexts.communities.actions.community-options.view :as options]
|
||||
@@ -33,7 +34,7 @@
|
||||
(defn screen-title
|
||||
[]
|
||||
[rn/view
|
||||
{:style style/screen-title-container}
|
||||
{:style (style/screen-title-container (safe-area/get-top))}
|
||||
[quo/text
|
||||
{:accessibility-label :communities-screen-title
|
||||
:weight :semi-bold
|
||||
@@ -183,7 +184,6 @@
|
||||
view-type]
|
||||
(fn []
|
||||
[rn/view
|
||||
{:style style/render-communities-container}
|
||||
[discover-communities-header
|
||||
{:selected-tab selected-tab
|
||||
:view-type view-type
|
||||
@@ -196,7 +196,7 @@
|
||||
(fn []
|
||||
(when (> @scroll-height 360)
|
||||
[rn/view
|
||||
{:style (style/blur-tabs-header)}
|
||||
{:style (style/blur-tabs-header (safe-area/get-top))}
|
||||
[discover-communities-segments selected-tab true]])))
|
||||
|
||||
(defn discover-screen-content
|
||||
@@ -209,6 +209,7 @@
|
||||
[scroll-page/scroll-page
|
||||
{:theme theme
|
||||
:on-scroll #(reset! scroll-height %)
|
||||
:page-nav-props {:background :blur}
|
||||
:navigate-back? :true
|
||||
:height (if (> @scroll-height 360)
|
||||
208
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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,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": "1256d8121e6fae4fc4517736a271624e473d5417",
|
||||
"commit-sha1": "1256d8121e6fae4fc4517736a271624e473d5417",
|
||||
"src-sha256": "0v9pbb79r8avvlx6ss7czj2j3s8csb2j2gkwavjbya6bys80hqmf"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user