Communities - Display community rules at request to join (#18082)
This update introduces a feature that displays community rules to users as they join.
This commit is contained in:
parent
4376ee8908
commit
2bc7b62324
|
@ -74,6 +74,7 @@
|
|||
:adminSettings :admin-settings
|
||||
:tokenPermissions :token-permissions
|
||||
:communityTokensMetadata :tokens-metadata
|
||||
:introMessage :intro-message
|
||||
:muteTill :muted-till})
|
||||
(update :admin-settings
|
||||
set/rename-keys
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
[react-native.core :as rn]
|
||||
[react-native.gesture :as gesture]
|
||||
[status-im2.common.password-authentication.view :as password-authentication]
|
||||
[status-im2.contexts.communities.actions.community-rules.view :as community-rules]
|
||||
[status-im2.contexts.communities.actions.request-to-join.style :as style]
|
||||
[utils.i18n :as i18n]
|
||||
[utils.re-frame :as rf]))
|
||||
|
@ -26,6 +27,13 @@
|
|||
[rn/view {:flex 1}
|
||||
[gesture/scroll-view {:style {:flex 1}}
|
||||
[rn/view style/page-container
|
||||
[quo/text
|
||||
{:style {:margin-top 24}
|
||||
:accessibility-label :community-rules-title
|
||||
:weight :semi-bold
|
||||
:size :paragraph-1}
|
||||
(i18n/label :t/community-rules)]
|
||||
[community-rules/view id]
|
||||
[rn/view {:style (style/bottom-container)}
|
||||
[quo/button
|
||||
{:accessibility-label :cancel
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
(ns status-im2.contexts.communities.actions.community-rules.style)
|
||||
|
||||
(def community-rule
|
||||
{:flex 1
|
||||
:align-items :flex-start
|
||||
:margin-top 16})
|
||||
|
||||
(def community-rule-text
|
||||
{:margin-left 6
|
||||
:flex 1})
|
|
@ -0,0 +1,16 @@
|
|||
(ns status-im2.contexts.communities.actions.community-rules.view
|
||||
(:require
|
||||
[quo.core :as quo]
|
||||
[react-native.core :as rn]
|
||||
[status-im2.contexts.communities.actions.community-rules.style :as style]
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
(defn view
|
||||
[id]
|
||||
(let [rules (rf/sub [:communities/rules id])]
|
||||
[rn/view {:style style/community-rule}
|
||||
[quo/text
|
||||
{:style style/community-rule-text
|
||||
:weight :regular
|
||||
:size :paragraph-2}
|
||||
rules]]))
|
|
@ -329,3 +329,9 @@
|
|||
:<- [:communities]
|
||||
(fn [communities [_ id]]
|
||||
(get-in communities [id :images])))
|
||||
|
||||
(re-frame/reg-sub
|
||||
:communities/rules
|
||||
:<- [:communities]
|
||||
(fn [communities [_ community-id]]
|
||||
(get-in communities [community-id :intro-message])))
|
||||
|
|
Loading…
Reference in New Issue