0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-09 00:10:11 -05:00

🐛 Fix view role user have menu option for unpublish a library

This commit is contained in:
Pablo Alba 2024-10-25 17:42:21 +02:00
parent 9728f1ba80
commit 122acb3eee

View file

@ -479,7 +479,7 @@
(mf/defc file-menu*
{::mf/props :obj
::mf/private true}
[{:keys [on-close file can-edit]}]
[{:keys [on-close file]}]
(let [file-id (:id file)
shared? (:is-shared file)
@ -487,6 +487,9 @@
frames (->> (cfh/get-immediate-children objects uuid/zero)
(filterv cfh/frame-shape?))
perms (mf/use-ctx ctx/team-permissions)
can-edit (:can-edit perms)
on-remove-shared
(mf/use-fn
(mf/deps file-id)
@ -567,11 +570,12 @@
:on-close on-close}
(if ^boolean shared?
[:> dropdown-menu-item* {:class (stl/css :submenu-item)
:on-click on-remove-shared
:on-key-down on-remove-shared-key-down
:id "file-menu-remove-shared"}
[:span {:class (stl/css :item-name)} (tr "dashboard.unpublish-shared")]]
(when can-edit
[:> dropdown-menu-item* {:class (stl/css :submenu-item)
:on-click on-remove-shared
:on-key-down on-remove-shared-key-down
:id "file-menu-remove-shared"}
[:span {:class (stl/css :item-name)} (tr "dashboard.unpublish-shared")]])
(when can-edit
[:> dropdown-menu-item* {:class (stl/css :submenu-item)