diff --git a/src/status_im/communities/core.cljs b/src/status_im/communities/core.cljs index dfedadb4fd..9001ab59b8 100644 --- a/src/status_im/communities/core.cljs +++ b/src/status_im/communities/core.cljs @@ -221,12 +221,10 @@ (fx/defn create {:events [::create-confirmation-pressed]} [{:keys [db]}] - (let [{:keys [name description image]} (get db :communities/create)] - ;; If access is ENS only, we set the access to require approval and set the rule - ;; of ens only + (let [{:keys [name description membership image]} (get db :communities/create)] (let [params {:name name :description description - :membership constants/community-on-request-access + :membership membership :color (rand-nth colors/chat-colors) :image (string/replace-first (str image) #"file://" "") :imageAx 0 diff --git a/src/status_im/ui/components/profile_header/view.cljs b/src/status_im/ui/components/profile_header/view.cljs index 411de6d9ee..506c7b6f58 100644 --- a/src/status_im/ui/components/profile_header/view.cljs +++ b/src/status_im/ui/components/profile_header/view.cljs @@ -38,7 +38,7 @@ {:padding-top subtitle-margin}))) (defn extended-header - [{:keys [title photo color subtitle subtitle-icon on-edit on-press monospace + [{:keys [title photo color membership subtitle subtitle-icon on-edit on-press monospace bottom-separator emoji public-key community?] :or {bottom-separator true}}] (fn [{:keys [animation minimized]}] @@ -70,6 +70,12 @@ :accessibility-role :text :accessibility-label :default-username} title] + (when membership [quo/text {:number-of-lines 1 + :ellipsize-mode :middle + :monospace monospace + :size (if minimized :small :base) + :color :secondary} + membership]) (when subtitle [animated/view {:style (header-subtitle {:minimized minimized}) :pointer-events :box-none} diff --git a/src/status_im/ui/screens/communities/create.cljs b/src/status_im/ui/screens/communities/create.cljs index c53faa4eb5..f3a50ecb98 100644 --- a/src/status_im/ui/screens/communities/create.cljs +++ b/src/status_im/ui/screens/communities/create.cljs @@ -9,6 +9,7 @@ [status-im.utils.image :as utils.image] [quo.design-system.colors :as colors] [status-im.ui.components.react :as react] + [status-im.ui.screens.communities.membership :as memberships] [status-im.ui.components.icons.icons :as icons] [status-im.utils.debounce :as debounce])) @@ -128,7 +129,7 @@ (str (count text) "/" max-length)]]) (defn form [] - (let [{:keys [name description]} (evt [::communities/create-field :description %])}]] [quo/list-header {:color :main} (i18n/label :t/community-thumbnail-image)] - [photo-picker]])) + [photo-picker] + (when-not editing? [:<> + [quo/separator {:style {:margin-vertical 10}}] + [quo/list-item {:title (i18n/label :t/membership-button) + :accessory-text (i18n/label (get-in memberships/options [membership :title] :t/membership-none)) + :accessory :text + :on-press #(>evt [:navigate-to :community-membership]) + :chevron true + :size :small}] + [quo/list-footer + (i18n/label (get-in memberships/options [membership :description] :t/membership-none-placeholder))]])])) (defn view [] (let [{:keys [name description]} ( [quo/animated-header {:left-accessories [{:icon :main-icons/arrow-left @@ -39,6 +40,8 @@ (rn/resolve-asset-source (resources/get-image :status-logo))) (get-in community [:images :large :uri])) + :membership (when request-membership? + (i18n/label :t/membership-approval)) :subtitle (if show-members-count? (i18n/label-pluralize members-count :t/community-members {:count members-count}) (i18n/label :t/open-membership))