updated leave button background color to community color
This commit is contained in:
parent
b0964eff64
commit
f114908c4d
|
@ -112,13 +112,13 @@
|
||||||
:on-press #(hide-sheet-and-dispatch [:communities/share-community-pressed id])})
|
:on-press #(hide-sheet-and-dispatch [:communities/share-community-pressed id])})
|
||||||
|
|
||||||
(defn leave-community
|
(defn leave-community
|
||||||
[id]
|
[id color]
|
||||||
{:icon :i/log-out
|
{:icon :i/log-out
|
||||||
:label (i18n/label :t/leave-community)
|
:label (i18n/label :t/leave-community)
|
||||||
:accessibility-label :leave-community
|
:accessibility-label :leave-community
|
||||||
:danger? true
|
:danger? true
|
||||||
:on-press #(rf/dispatch [:show-bottom-sheet
|
: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
|
(defn cancel-request-to-join
|
||||||
[id request-id]
|
[id request-id]
|
||||||
|
@ -152,7 +152,7 @@
|
||||||
(not-joined-options id token-gated? pending?)))
|
(not-joined-options id token-gated? pending?)))
|
||||||
|
|
||||||
(defn joined-options
|
(defn joined-options
|
||||||
[id token-gated? muted? muted-till]
|
[id token-gated? muted? muted-till color]
|
||||||
[[(view-members id)
|
[[(view-members id)
|
||||||
(view-rules id)
|
(view-rules id)
|
||||||
(when token-gated? (view-token-gating id))
|
(when token-gated? (view-token-gating id))
|
||||||
|
@ -164,7 +164,7 @@
|
||||||
(invite-contacts id)
|
(invite-contacts id)
|
||||||
(show-qr id)
|
(show-qr id)
|
||||||
(share-community id)]
|
(share-community id)]
|
||||||
[(assoc (leave-community id) :add-divider? true)]])
|
[(assoc (leave-community id color) :add-divider? true)]])
|
||||||
|
|
||||||
(defn owner-options
|
(defn owner-options
|
||||||
[id token-gated? muted? muted-till]
|
[id token-gated? muted? muted-till]
|
||||||
|
@ -181,11 +181,11 @@
|
||||||
(defn get-context-drawers
|
(defn get-context-drawers
|
||||||
[{:keys [id]}]
|
[{:keys [id]}]
|
||||||
(let [{:keys [token-permissions admin joined
|
(let [{:keys [token-permissions admin joined
|
||||||
muted banList muted-till]} (rf/sub [:communities/community id])
|
muted banList muted-till color]} (rf/sub [:communities/community id])
|
||||||
request-id (rf/sub [:communities/my-pending-request-to-join id])]
|
request-id (rf/sub [:communities/my-pending-request-to-join id])]
|
||||||
(cond
|
(cond
|
||||||
admin (owner-options id token-permissions muted muted-till)
|
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)
|
request-id (join-request-sent-options id token-permissions request-id)
|
||||||
banList (banned-options id token-permissions)
|
banList (banned-options id token-permissions)
|
||||||
:else (not-joined-options id token-permissions request-id))))
|
:else (not-joined-options id token-permissions request-id))))
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
(rf/dispatch event))
|
(rf/dispatch event))
|
||||||
|
|
||||||
(defn leave-sheet
|
(defn leave-sheet
|
||||||
[id]
|
[id color]
|
||||||
[generic-menu/view
|
[generic-menu/view
|
||||||
{:id id
|
{:id id
|
||||||
:title (i18n/label :t/leave-community?)}
|
:title (i18n/label :t/leave-community?)}
|
||||||
|
@ -31,8 +31,9 @@
|
||||||
:container-style style/cancel-button}
|
:container-style style/cancel-button}
|
||||||
(i18n/label :t/cancel)]
|
(i18n/label :t/cancel)]
|
||||||
[quo/button
|
[quo/button
|
||||||
{:on-press #(hide-sheet-and-dispatch [:communities/leave id])
|
{:on-press #(hide-sheet-and-dispatch [:communities/leave id])
|
||||||
:container-style style/action-button}
|
:customization-color color
|
||||||
|
:container-style style/action-button}
|
||||||
(i18n/label :t/leave-community)]]]])
|
(i18n/label :t/leave-community)]]]])
|
||||||
|
|
||||||
(defn cancel-request-sheet
|
(defn cancel-request-sheet
|
||||||
|
|
Loading…
Reference in New Issue