This commit is contained in:
Ibrahem Khalil 2024-03-17 11:21:39 +02:00 committed by ibrkhalil
parent cabe377938
commit aa1ce42079
No known key found for this signature in database
GPG Key ID: 4DC01DE789FD7BD3
3 changed files with 16 additions and 16 deletions

View File

@ -9,7 +9,7 @@
[schema.core :as schema]))
(defn- description-comp
[description members-count active-members-count token-gated?]
[description members-count active-members-count hide-members-count?]
(let [positive-members-count? (pos? members-count)
positive-active-members-count? (pos? active-members-count)]
[rn/view
@ -18,7 +18,7 @@
:number-of-lines 3
:accessibility-label :description}
description]
(when-not token-gated?
(when-not hide-members-count?
[rn/view
{:style style/stat-container}
(when positive-members-count?

View File

@ -17,17 +17,17 @@
community-name :display-name
members-count :members-count
community-id :community-id} community
token-gated? (rf/sub
[:communities/token-gated?
token-gated-not-a-member? (rf/sub
[:communities/token-gated-not-a-member?
community-id])]
^{:key url}
[quo/internal-link-card
{:type :community
:size :message
:description community-description
:members-count members-count
:title community-name
:banner (:url community-banner)
:icon (:url community-icon)
:on-press #(rf/dispatch [:universal-links/handle-url url])
:token-gated? token-gated?}])))])))
{:type :community
:size :message
:description community-description
:members-count members-count
:title community-name
:banner (:url community-banner)
:icon (:url community-icon)
:on-press #(rf/dispatch [:universal-links/handle-url url])
:hide-members-count? token-gated-not-a-member?}])))])))

View File

@ -429,8 +429,8 @@
(boolean (some seq all-tokens)))))
(re-frame/reg-sub
:communities/token-gated?
:communities/token-gated-not-a-member?
(fn [[_ community-id]]
[(re-frame/subscribe [:communities/community community-id])])
(fn [[{:keys [membership-permissions?]}] _]
membership-permissions?))
(fn [[{:keys [token-permissions joined]}] _]
(and (not joined) (seq token-permissions))))