mirror of
https://github.com/penpot/penpot.git
synced 2026-10-29 05:50:35 +00:00
🐛 Show the themes permission message only to non-editors (#12203)
The theme selector showed "You need to be an editor to use themes" whenever tokens could not be edited. That is also the case for editors when the tokens source is a library, and they can still switch themes. Base the message on file edit permission instead. Closes #12177 AI-assisted-by: claude-opus-5-5
This commit is contained in:
parent
f9515a69ca
commit
9931d82379
@ -23,6 +23,9 @@
|
||||
(let [ordered-themes
|
||||
(mf/deref refs/workspace-token-themes-no-hidden)
|
||||
|
||||
can-edit-file?
|
||||
(mf/use-ctx ctx/can-edit?)
|
||||
|
||||
can-edit-tokens?
|
||||
(mf/use-ctx ctx/can-edit-tokens?)
|
||||
|
||||
@ -50,6 +53,6 @@
|
||||
:class (stl/css :edit-theme-button)
|
||||
:on-click open-modal}
|
||||
(tr "labels.edit")]]
|
||||
[:div {:title (when-not can-edit-tokens?
|
||||
[:div {:title (when-not can-edit-file?
|
||||
(tr "workspace.tokens.no-permission-themes"))}
|
||||
[:> theme-selector* {:tokens-source tokens-source}]]))]))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user