Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated leave button background color to community color #19429

Merged
merged 1 commit into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,13 @@
:on-press #(hide-sheet-and-dispatch [:communities/share-community-pressed id])})

(defn leave-community
[id]
[id color]
{:icon :i/log-out
:label (i18n/label :t/leave-community)
:accessibility-label :leave-community
:danger? true
:on-press #(rf/dispatch [:show-bottom-sheet
{:content (fn [] [leave-menu/leave-sheet id])}])})
{:content (fn [] [leave-menu/leave-sheet id color])}])})

(defn cancel-request-to-join
[id request-id]
Expand Down Expand Up @@ -152,7 +152,7 @@
(not-joined-options id token-gated? pending?)))

(defn joined-options
[id token-gated? muted? muted-till]
[id token-gated? muted? muted-till color]
[[(view-members id)
(view-rules id)
(when token-gated? (view-token-gating id))
Expand All @@ -164,7 +164,7 @@
(invite-contacts id)
(show-qr id)
(share-community id)]
[(assoc (leave-community id) :add-divider? true)]])
[(assoc (leave-community id color) :add-divider? true)]])

(defn owner-options
[id token-gated? muted? muted-till]
Expand All @@ -181,11 +181,11 @@
(defn get-context-drawers
[{:keys [id]}]
(let [{:keys [token-permissions admin joined
muted banList muted-till]} (rf/sub [:communities/community id])
request-id (rf/sub [:communities/my-pending-request-to-join id])]
muted banList muted-till color]} (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)
joined (joined-options id token-permissions muted muted-till)
joined (joined-options id token-permissions muted muted-till color)
request-id (join-request-sent-options id token-permissions request-id)
banList (banned-options id token-permissions)
:else (not-joined-options id token-permissions request-id))))
Expand Down
7 changes: 4 additions & 3 deletions src/status_im/contexts/communities/actions/leave/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
(rf/dispatch event))

(defn leave-sheet
[id]
[id color]
[generic-menu/view
{:id id
:title (i18n/label :t/leave-community?)}
Expand All @@ -31,8 +31,9 @@
:container-style style/cancel-button}
(i18n/label :t/cancel)]
[quo/button
{:on-press #(hide-sheet-and-dispatch [:communities/leave id])
:container-style style/action-button}
{:on-press #(hide-sheet-and-dispatch [:communities/leave id])
:customization-color color
:container-style style/action-button}
(i18n/label :t/leave-community)]]]])

(defn cancel-request-sheet
Expand Down