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:
parent
9728f1ba80
commit
122acb3eee
1 changed files with 10 additions and 6 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue