fix: hide buttons on community after joining (#14761)

This commit is contained in:
Jamie Caprani 2023-01-31 17:11:41 +00:00 committed by GitHub
parent 41124acf4d
commit 1f84128dd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 13 deletions

View File

@ -170,7 +170,7 @@
(re-frame/dispatch [::failed-to-join %]))}]})
(rf/defn request-to-join
{:events [::request-to-join]}
{:events [:communities/request-to-join]}
[cofx community-id]
{:json-rpc/call [{:method "wakuext_requestToJoinCommunity"
:params [{:communityId community-id}]

View File

@ -323,7 +323,7 @@
[toolbar/toolbar
{:show-border? true
:center [quo/button
{:on-press #(rf/dispatch [::communities/request-to-join id])
{:on-press #(rf/dispatch [:communities/request-to-join id])
:type :secondary}
(i18n/label :t/request-access)]}])
:else

View File

@ -72,7 +72,7 @@
:mid-section {:type :text-with-description
:main-text nil
:description-img nil}
:right-section-buttons (:right-section-buttons page-nav)
:right-section-buttons page-nav
:left-section {:icon :i/close
:icon-background-color (icon-color)
:on-press #(rf/dispatch [:navigate-back])}}]

View File

@ -2,7 +2,6 @@
(:require [quo.react-native :as rn]
[quo2.core :as quo]
[reagent.core :as reagent]
[status-im.communities.core :as communities]
[utils.i18n :as i18n]
[status-im2.contexts.communities.menus.request-to-join.style :as style]
[utils.re-frame :as rf]
@ -121,13 +120,13 @@
{:accessibility-label :join-community-button
:on-press (fn []
(if can-join?
(do (rf/dispatch [:bottom-sheet/hide])
(rf/dispatch [::communities/join id]))
(do
(and can-request-access?
(rf/dispatch [:communities/join id])
(rf/dispatch [:bottom-sheet/hide]))
(do (and can-request-access?
(not (pos? requested-to-join-at))
(requests/can-request-access-again? requested-to-join-at))
(rf/dispatch [::communities/request-to-join id])
(rf/dispatch [:communities/request-to-join id])
(rf/dispatch [:bottom-sheet/hide]))))
:disabled (not @agreed-to-rules?)
:style {:flex 1}} (request-to-join-text is-open?)]]])))

View File

@ -271,7 +271,7 @@
{:label (:label label)
:chevron-position :left}]])))
(defn community-overview-right-section-buttons
(defn page-nav-right-section-buttons
[id]
[{:icon :i/options
:background-color (scroll-page/icon-color)
@ -291,7 +291,7 @@
(fn [community]
[scroll-page/scroll-page
{:cover-image cover
:page-nav-right-section-buttons (community-overview-right-section-buttons id)
:page-nav-right-section-buttons (page-nav-right-section-buttons id)
:name name
:on-scroll #(reset! scroll-height %)}