0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-22 14:39:45 -05:00

Inline separator

This commit is contained in:
Florian Schroedl 2024-07-24 10:59:26 +02:00
parent 08cc777096
commit fbd2ab833d

View file

@ -475,17 +475,13 @@
:on-context-menu prevent-default} :on-context-menu prevent-default}
children]])]))) children]])])))
(mf/defc menu-separator
[]
[:li {:class (stl/css :separator)}])
(mf/defc context-menu-tree (mf/defc context-menu-tree
[context-data] [context-data]
(let [entries (generate-menu-entries context-data)] (let [entries (generate-menu-entries context-data)]
(for [[index {:keys [title action selected? submenu] :as entry}] (d/enumerate entries)] (for [[index {:keys [title action selected? submenu] :as entry}] (d/enumerate entries)]
[:* {:key (str title " " index)} [:* {:key (str title " " index)}
(cond (cond
(= :separator entry) [:& menu-separator] (= :separator entry) [:li {:class (stl/css :separator)}]
submenu [:& menu-entry {:title title} submenu [:& menu-entry {:title title}
[:& context-menu-tree (assoc context-data :type submenu)]] [:& context-menu-tree (assoc context-data :type submenu)]]
:else [:& menu-entry :else [:& menu-entry