0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-20 13:42:59 -05:00

🐛 Hide empty message when creating set

This commit is contained in:
Andrés Moya 2024-11-07 17:52:14 +01:00 committed by Andrés Moya
parent cfaf9b8890
commit b3c5f8f695

View file

@ -200,14 +200,18 @@
(mf/defc add-set-button
[{:keys [on-open style]}]
(let [{:keys [on-create]} (sets-context/use-context)
(let [{:keys [on-create new?]} (sets-context/use-context)
on-click #(do
(on-open)
(on-create))]
(if (= style "inline")
(when-not new?
[:div {:class (stl/css :empty-sets-wrapper)}
[:> text* {:as "span" :typography "body-small" :class (stl/css :empty-state-message)}
(tr "workspace.token.no-sets-yet")]
[:button {:on-click on-click
:class (stl/css :create-theme-button)}
(tr "workspace.token.create-one")]
(tr "workspace.token.create-one")]])
[:> icon-button* {:variant "ghost"
:icon "add"
:on-click on-click
@ -232,14 +236,10 @@
:style "header"}]]]
(when @open?
[:& h/sortable-container {}
[:*
(when (empty? token-sets)
[:div {:class (stl/css :empty-sets-wrapper)}
[:> text* {:as "span" :typography "body-small" :class (stl/css :empty-state-message)}
(tr "workspace.token.no-sets-yet")]
[:& add-set-button {:on-open on-open
:style "inline"}]])
[:& sets-list]]])]]))
:style "inline"}])
[:& sets-list]])]]))
(mf/defc tokens-tab
[_props]