Skip to content

Commit

Permalink
support disabled state on context menu items
Browse files Browse the repository at this point in the history
  • Loading branch information
sprocketc committed Mar 4, 2024
1 parent 2b0e720 commit 5ee4246
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/renderer/components.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
[renderer.components/icon icon]])

(defn context-menu-item
[{:keys [type label action checked?]}]
[{:keys [type label action checked? disabled?]}]
(case type
:separator
[:> ContextMenu/Separator {:class "menu-separator"}]
Expand All @@ -91,7 +91,8 @@
[:> ContextMenu/CheckboxItem
{:class "menu-checkbox-item inset"
:onSelect #(rf/dispatch action)
:checked @(rf/subscribe checked?)}
:checked @(rf/subscribe checked?)
:disabled disabled?}
[:> ContextMenu/ItemIndicator
{:class "menu-item-indicator"}
[icon "checkmark"]]
Expand All @@ -101,7 +102,8 @@

[:> ContextMenu/Item
{:class "menu-item context-menu-item"
:onSelect #(rf/dispatch action)}
:onSelect #(rf/dispatch action)
:disabled disabled?}
label
[:div.right-slot
[shortcuts action]]]))
Expand Down

0 comments on commit 5ee4246

Please sign in to comment.