0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-23 07:16:07 -05:00

🐛 Fix on libraries section, items shouldn't have context menu

This commit is contained in:
Pablo Alba 2024-12-26 15:44:03 +01:00
parent 54c63fef06
commit 6bd1f19e36

View file

@ -331,6 +331,15 @@
client-position)]
(st/emit! (dd/show-file-menu-with-position file-id position)))))
on-context-menu
(mf/use-fn
(mf/deps is-library-view)
(fn [event]
(dom/stop-propagation event)
(dom/prevent-default event)
(when-not is-library-view
(on-menu-click event))))
edit
(mf/use-fn
(mf/deps file)
@ -373,7 +382,7 @@
:on-key-down handle-key-down
:on-double-click on-navigate
:on-drag-start on-drag-start
:on-context-menu on-menu-click}
:on-context-menu on-context-menu}
[:div {:class (stl/css :overlay)}]
@ -392,6 +401,7 @@
[:h3 (:name file)])
[:& grid-item-metadata {:modified-at (:modified-at file)}]]
(when-not is-library-view
[:div {:class (stl/css-case :project-th-actions true :force-display (:menu-open dashboard-local))}
[:div
{:class (stl/css :project-th-icon :menu)
@ -416,7 +426,7 @@
:on-edit on-edit
:on-menu-close on-menu-close
:origin origin
:parent-id (dm/str file-id "-action-menu")}]])]]]]]))
:parent-id (dm/str file-id "-action-menu")}]])]])]]]))
(mf/defc grid
{::mf/props :obj}