diff --git a/src/status_im/contexts/communities/actions/chat/view.cljs b/src/status_im/contexts/communities/actions/chat/view.cljs index 5eaeb207cb..3dee2d0c80 100644 --- a/src/status_im/contexts/communities/actions/chat/view.cljs +++ b/src/status_im/contexts/communities/actions/chat/view.cljs @@ -112,12 +112,14 @@ (defn actions [{:keys [locked? chat-id community-id]} inside-chat? hide-view-members?] - (let [{:keys [muted muted-till chat-type]} (rf/sub [:chats/chat-by-id chat-id])] + (let [{:keys [muted muted-till chat-type]} (rf/sub [:chats/chat-by-id chat-id]) + {:keys [token-gated?]} (rf/sub [:chats/community-chat-by-id community-id chat-id])] (cond locked? [quo/action-drawer [[(action-invite-people) - (action-token-requirements) + (when token-gated? + (action-token-requirements)) (action-qr-code chat-id) (action-share chat-id)]]] @@ -135,7 +137,8 @@ (and inside-chat? (not locked?)) [quo/action-drawer [[(action-view-members-and-details community-id chat-id) - (action-token-requirements) + (when token-gated? + (action-token-requirements)) (action-mark-as-read) (action-toggle-muted chat-id muted muted-till chat-type) (action-notification-settings) diff --git a/src/status_im/contexts/communities/actions/community_options/component_spec.cljs b/src/status_im/contexts/communities/actions/community_options/component_spec.cljs index 9bc931e4a2..3679771d09 100644 --- a/src/status_im/contexts/communities/actions/community_options/component_spec.cljs +++ b/src/status_im/contexts/communities/actions/community_options/component_spec.cljs @@ -23,7 +23,7 @@ (h/test "joined options - Token Gated" (h/setup-subs {:communities/my-pending-request-to-join nil :communities/community {:joined true - :token-permissions []}}) + :role-permissions? true}}) (h/render [options/community-options-bottom-sheet {:id "test"}]) (h/is-truthy (h/get-by-translation-text :t/view-members)) (h/is-truthy (h/get-by-translation-text :t/view-community-rules)) @@ -52,7 +52,7 @@ (h/test "admin options - Token Gated" (h/setup-subs {:communities/my-pending-request-to-join nil :communities/community {:admin true - :token-permissions []}}) + :role-permissions? true}}) (h/render [options/community-options-bottom-sheet {:id "test"}]) (h/is-truthy (h/get-by-translation-text :t/view-members)) (h/is-truthy (h/get-by-translation-text :t/view-community-rules)) @@ -76,7 +76,7 @@ (h/test "request sent options - Token Gated" (h/setup-subs {:communities/my-pending-request-to-join "mock-id" - :communities/community {:token-permissions []}}) + :communities/community {:role-permissions? true}}) (h/render [options/community-options-bottom-sheet {:id "test"}]) (h/is-truthy (h/get-by-translation-text :t/invite-people-from-contacts)) (h/is-truthy (h/get-by-translation-text :t/view-token-gating)) @@ -97,7 +97,7 @@ (h/test "banned options - Token Gated" (h/setup-subs {:communities/my-pending-request-to-join nil :communities/community {:banList 100 - :token-permissions []}}) + :role-permissions? true}}) (h/render [options/community-options-bottom-sheet {:id "test"}]) (h/is-truthy (h/get-by-translation-text :t/invite-people-from-contacts)) (h/is-truthy (h/get-by-translation-text :t/view-token-gating)) @@ -107,7 +107,7 @@ (h/test "banned options - Token Gated" (h/setup-subs {:communities/my-pending-request-to-join nil :communities/community {:banList 100 - :token-permissions []}}) + :role-permissions? true}}) (h/render [options/community-options-bottom-sheet {:id "test"}]) (h/is-truthy (h/get-by-translation-text :t/invite-people-from-contacts)) (h/is-truthy (h/get-by-translation-text :t/view-token-gating)) @@ -118,6 +118,6 @@ (h/setup-subs {:communities/my-pending-request-to-join nil :communities/community {:joined true :muted true - :token-permissions []}}) + :role-permissions? true}}) (h/render [options/community-options-bottom-sheet {:id "test"}]) (h/is-truthy (h/get-by-translation-text :t/unmute-community)))) diff --git a/src/status_im/contexts/communities/actions/community_options/view.cljs b/src/status_im/contexts/communities/actions/community_options/view.cljs index 2632b5838b..a8e16850e4 100644 --- a/src/status_im/contexts/communities/actions/community_options/view.cljs +++ b/src/status_im/contexts/communities/actions/community_options/view.cljs @@ -180,16 +180,16 @@ (defn get-context-drawers [{:keys [id]}] - (let [{:keys [token-permissions admin joined + (let [{:keys [role-permissions? admin joined muted banList muted-till color intro-message]} (rf/sub [:communities/community id]) request-id (rf/sub [:communities/my-pending-request-to-join id])] (cond - admin (owner-options id token-permissions muted muted-till intro-message) - joined (joined-options id token-permissions muted muted-till color intro-message) - request-id (join-request-sent-options id token-permissions request-id intro-message) - banList (banned-options id token-permissions intro-message) - :else (not-joined-options id token-permissions request-id intro-message)))) + admin (owner-options id role-permissions? muted muted-till intro-message) + joined (joined-options id role-permissions? muted muted-till color intro-message) + request-id (join-request-sent-options id role-permissions? request-id intro-message) + banList (banned-options id role-permissions? intro-message) + :else (not-joined-options id role-permissions? request-id intro-message)))) (defn community-options-bottom-sheet [id]