Add members to open community

* add members to open community

* fix: join open community notification
This commit is contained in:
John Ngei 2023-08-18 15:38:35 +03:00 committed by GitHub
parent 99294fa8ea
commit 66e3b60703
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 13 deletions

View File

@ -220,15 +220,6 @@
(log/error "failed to import community" %)
(re-frame/dispatch [::failed-to-import %]))}]})
(rf/defn join
{:events [:communities/join]}
[_ community-id]
{:json-rpc/call [{:method "wakuext_joinCommunity"
:params [community-id]
:js-response true
:on-success #(re-frame/dispatch [::joined %])
:on-error #(log/error "failed to join community" community-id %)}]})
(rf/defn request-to-join
{:events [:communities/request-to-join]}
[_ community-id]

View File

@ -67,7 +67,7 @@
:on-press (fn []
(if can-join?
(do
(rf/dispatch [:communities/join id])
(rf/dispatch [:communities/request-to-join id])
(rf/dispatch [:navigate-back]))
(do (and can-request-access?
(not pending?)

View File

@ -21,9 +21,11 @@
(defn- get-header-text-and-context
[community membership-status]
(let [community-name (:name community)
permissions (:permissions community)
community-image (get-in community [:images :thumbnail :uri])
community-context-tag [quo/context-tag common/tag-params community-image
community-name]]
community-name]
open? (not= 3 (:access permissions))]
(cond
(= membership-status constants/activity-center-membership-status-idle)
{:header-text (i18n/label :t/community-request-not-accepted)
@ -40,9 +42,14 @@
community-context-tag]}
(= membership-status constants/activity-center-membership-status-accepted)
{:header-text (i18n/label :t/community-request-accepted)
{:header-text (i18n/label (if open?
:t/join-open-community
:t/community-request-accepted))
:context [[quo/text {:style common-style/user-avatar-tag-text}
(i18n/label :t/community-request-accepted-body-text)]
(i18n/label (if open?
:t/joined-community
:t/community-request-accepted-body-text)
(when open? {:community community-name}))]
community-context-tag]}
:else nil)))

View File

@ -196,6 +196,7 @@
"communities-verified": "✓ Verified Status Community",
"communities-enabled": "Communities enabled",
"request-access": "Request access",
"requesting": "Requesting",
"membership-request-pending": "Membership request pending",
"create-community": "Create a community",
"create-category": "Create category",