Fix loading screen for fetching community (#19968)

This commit is contained in:
Parvesh Monu 2024-05-13 20:52:05 +05:30 committed by GitHub
parent 112768d13a
commit a6cd97482c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 15 deletions

View File

@ -21,12 +21,10 @@
:align-items :center
:margin-top 20})
(def fetching-placeholder
{:align-items :center
:justify-content :center
:flex 1})
(def fetching-text {:color :red})
(defn fetching-placeholder
[top-inset]
{:flex 1
:margin-top top-inset})
(def blur-channel-header
{:position :absolute

View File

@ -6,9 +6,10 @@
[quo.theme]
[react-native.blur :as blur]
[react-native.core :as rn]
[react-native.safe-area :as safe-area]
[reagent.core :as reagent]
[status-im.common.home.actions.view :as actions]
[status-im.common.not-implemented :as not-implemented]
[status-im.common.resources :as resources]
[status-im.common.scroll-page.style :as scroll-page.style]
[status-im.common.scroll-page.view :as scroll-page]
[status-im.config :as config]
@ -369,18 +370,25 @@
(defn- community-fetching-placeholder
[id]
(let [fetching? (rf/sub [:communities/fetching-community id])]
(let [theme (quo.theme/use-theme)
top-inset (safe-area/get-top)
fetching? (rf/sub [:communities/fetching-community id])]
[rn/view
{:style style/fetching-placeholder
{:style (style/fetching-placeholder top-inset)
:accessibility-label (if fetching?
:fetching-community-overview
:failed-to-fetch-community-overview)}
[not-implemented/not-implemented
[rn/text
{:style style/fetching-text}
(if fetching?
"Fetching community..."
"Failed to fetch community")]]]))
[quo/page-nav
{:title "Community Overview"
:type :title
:text-align :left
:icon-name :i/close
:on-press #(rf/dispatch [:navigate-back])}]
[quo/empty-state
{:image (resources/get-themed-image :cat-in-box theme)
:description (when-not fetching? (i18n/label :t/here-is-a-cat-in-a-box-instead))
:title (if fetching? "Fetching community..." "Failed to fetch community")
:container-style {:flex 1 :justify-content :center}}]]))
(defn- community-card-page-view
[id]