mirror of
https://github.com/status-im/status-react.git
synced 2025-02-02 14:14:39 +00:00
Add/Fix rebase overwritten event (#12960)
* Add/Fix rebase overwritten event * Remove membership invitation only option * Fix lint findings * Replace if w/ when condition * Remove left over code * Add/Fix rebase overwritten event * Remove left over code * Add correct message to community info
This commit is contained in:
parent
4318bb6431
commit
83a7d3fafc
@ -221,12 +221,10 @@
|
|||||||
(fx/defn create
|
(fx/defn create
|
||||||
{:events [::create-confirmation-pressed]}
|
{:events [::create-confirmation-pressed]}
|
||||||
[{:keys [db]}]
|
[{:keys [db]}]
|
||||||
(let [{:keys [name description image]} (get db :communities/create)]
|
(let [{:keys [name description membership 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 [params {:name name
|
(let [params {:name name
|
||||||
:description description
|
:description description
|
||||||
:membership constants/community-on-request-access
|
:membership membership
|
||||||
:color (rand-nth colors/chat-colors)
|
:color (rand-nth colors/chat-colors)
|
||||||
:image (string/replace-first (str image) #"file://" "")
|
:image (string/replace-first (str image) #"file://" "")
|
||||||
:imageAx 0
|
:imageAx 0
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
{:padding-top subtitle-margin})))
|
{:padding-top subtitle-margin})))
|
||||||
|
|
||||||
(defn extended-header
|
(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?]
|
bottom-separator emoji public-key community?]
|
||||||
:or {bottom-separator true}}]
|
:or {bottom-separator true}}]
|
||||||
(fn [{:keys [animation minimized]}]
|
(fn [{:keys [animation minimized]}]
|
||||||
@ -70,6 +70,12 @@
|
|||||||
:accessibility-role :text
|
:accessibility-role :text
|
||||||
:accessibility-label :default-username}
|
:accessibility-label :default-username}
|
||||||
title]
|
title]
|
||||||
|
(when membership [quo/text {:number-of-lines 1
|
||||||
|
:ellipsize-mode :middle
|
||||||
|
:monospace monospace
|
||||||
|
:size (if minimized :small :base)
|
||||||
|
:color :secondary}
|
||||||
|
membership])
|
||||||
(when subtitle
|
(when subtitle
|
||||||
[animated/view {:style (header-subtitle {:minimized minimized})
|
[animated/view {:style (header-subtitle {:minimized minimized})
|
||||||
:pointer-events :box-none}
|
:pointer-events :box-none}
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
[status-im.utils.image :as utils.image]
|
[status-im.utils.image :as utils.image]
|
||||||
[quo.design-system.colors :as colors]
|
[quo.design-system.colors :as colors]
|
||||||
[status-im.ui.components.react :as react]
|
[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.ui.components.icons.icons :as icons]
|
||||||
[status-im.utils.debounce :as debounce]))
|
[status-im.utils.debounce :as debounce]))
|
||||||
|
|
||||||
@ -128,7 +129,7 @@
|
|||||||
(str (count text) "/" max-length)]])
|
(str (count text) "/" max-length)]])
|
||||||
|
|
||||||
(defn form []
|
(defn form []
|
||||||
(let [{:keys [name description]} (<sub [:communities/create])]
|
(let [{:keys [name description membership editing?]} (<sub [:communities/create])]
|
||||||
[rn/scroll-view {:keyboard-should-persist-taps :handled
|
[rn/scroll-view {:keyboard-should-persist-taps :handled
|
||||||
:style {:flex 1}
|
:style {:flex 1}
|
||||||
:content-container-style {:padding-vertical 16}}
|
:content-container-style {:padding-vertical 16}}
|
||||||
@ -156,7 +157,17 @@
|
|||||||
:on-change-text #(>evt [::communities/create-field :description %])}]]
|
:on-change-text #(>evt [::communities/create-field :description %])}]]
|
||||||
[quo/list-header {:color :main}
|
[quo/list-header {:color :main}
|
||||||
(i18n/label :t/community-thumbnail-image)]
|
(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 []
|
(defn view []
|
||||||
(let [{:keys [name description]} (<sub [:communities/create])]
|
(let [{:keys [name description]} (<sub [:communities/create])]
|
||||||
|
@ -10,13 +10,6 @@
|
|||||||
(def options {constants/community-on-request-access
|
(def options {constants/community-on-request-access
|
||||||
{:title :t/membership-approval
|
{:title :t/membership-approval
|
||||||
:description :t/membership-approval-description}
|
:description :t/membership-approval-description}
|
||||||
constants/community-invitation-only-access
|
|
||||||
{:title :t/membership-invite
|
|
||||||
:description :t/membership-invite-description}
|
|
||||||
; disabled for now
|
|
||||||
; constants/community-rule-ens-only
|
|
||||||
; {:title :t/membership-ens
|
|
||||||
; :description :t/membership-ens-description}
|
|
||||||
constants/community-no-membership-access
|
constants/community-no-membership-access
|
||||||
{:title :t/membership-free
|
{:title :t/membership-free
|
||||||
:description :t/membership-free-description}})
|
:description :t/membership-free-description}})
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
roles false
|
roles false
|
||||||
notifications false
|
notifications false
|
||||||
show-members-count? (not= (:access permissions) constants/community-no-membership-access)
|
show-members-count? (not= (:access permissions) constants/community-no-membership-access)
|
||||||
|
request-membership? (= (:access permissions) constants/community-on-request-access)
|
||||||
members-count (count members)]
|
members-count (count members)]
|
||||||
[:<>
|
[:<>
|
||||||
[quo/animated-header {:left-accessories [{:icon :main-icons/arrow-left
|
[quo/animated-header {:left-accessories [{:icon :main-icons/arrow-left
|
||||||
@ -39,6 +40,8 @@
|
|||||||
(rn/resolve-asset-source
|
(rn/resolve-asset-source
|
||||||
(resources/get-image :status-logo)))
|
(resources/get-image :status-logo)))
|
||||||
(get-in community [:images :large :uri]))
|
(get-in community [:images :large :uri]))
|
||||||
|
:membership (when request-membership?
|
||||||
|
(i18n/label :t/membership-approval))
|
||||||
:subtitle (if show-members-count?
|
:subtitle (if show-members-count?
|
||||||
(i18n/label-pluralize members-count :t/community-members {:count members-count})
|
(i18n/label-pluralize members-count :t/community-members {:count members-count})
|
||||||
(i18n/label :t/open-membership))
|
(i18n/label :t/open-membership))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user