mirror of
https://github.com/penpot/penpot.git
synced 2025-01-20 05:34:23 -05:00
🐛 Fix new set not working with no sets
This commit is contained in:
parent
228080043f
commit
9819239d58
1 changed files with 13 additions and 8 deletions
|
@ -219,10 +219,20 @@
|
|||
:on-click on-click
|
||||
:aria-label (tr "workspace.token.add set")}])))
|
||||
|
||||
(mf/defc theme-sets-list
|
||||
[{:keys [on-open]}]
|
||||
(let [token-sets (mf/deref refs/workspace-ordered-token-sets)
|
||||
{:keys [new?] :as ctx} (sets-context/use-context)]
|
||||
(if (and (empty? token-sets)
|
||||
(not new?))
|
||||
[:& add-set-button {:on-open on-open
|
||||
:style "inline"}]
|
||||
[:& h/sortable-container {}
|
||||
[:& sets-list]])))
|
||||
|
||||
(mf/defc themes-sets-tab
|
||||
[{:keys [resize-height]}]
|
||||
(let [token-sets (mf/deref refs/workspace-ordered-token-sets)
|
||||
open? (mf/use-state true)
|
||||
(let [open? (mf/use-state true)
|
||||
on-open (mf/use-fn #(reset! open? true))]
|
||||
[:& sets-context/provider {}
|
||||
[:& sets-context-menu]
|
||||
|
@ -238,12 +248,7 @@
|
|||
:on-collapsed #(swap! open? not)}
|
||||
[:& add-set-button {:on-open on-open
|
||||
:style "header"}]]]
|
||||
(when @open?
|
||||
(if (empty? token-sets)
|
||||
[:& add-set-button {:on-open on-open
|
||||
:style "inline"}]
|
||||
[:& h/sortable-container {}
|
||||
[:& sets-list]]))]]]))
|
||||
[:& theme-sets-list {:on-open on-open}]]]]))
|
||||
|
||||
(mf/defc tokens-tab
|
||||
[_props]
|
||||
|
|
Loading…
Add table
Reference in a new issue