mirror of
https://github.com/penpot/penpot.git
synced 2025-07-31 20:48:21 +02:00
🐛 Hide empty message when creating set
This commit is contained in:
parent
cfaf9b8890
commit
b3c5f8f695
1 changed files with 12 additions and 12 deletions
|
@ -200,14 +200,18 @@
|
||||||
|
|
||||||
(mf/defc add-set-button
|
(mf/defc add-set-button
|
||||||
[{:keys [on-open style]}]
|
[{: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-click #(do
|
||||||
(on-open)
|
(on-open)
|
||||||
(on-create))]
|
(on-create))]
|
||||||
(if (= style "inline")
|
(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
|
[:button {:on-click on-click
|
||||||
:class (stl/css :create-theme-button)}
|
:class (stl/css :create-theme-button)}
|
||||||
(tr "workspace.token.create-one")]
|
(tr "workspace.token.create-one")]])
|
||||||
[:> icon-button* {:variant "ghost"
|
[:> icon-button* {:variant "ghost"
|
||||||
:icon "add"
|
:icon "add"
|
||||||
:on-click on-click
|
:on-click on-click
|
||||||
|
@ -232,14 +236,10 @@
|
||||||
:style "header"}]]]
|
:style "header"}]]]
|
||||||
(when @open?
|
(when @open?
|
||||||
[:& h/sortable-container {}
|
[:& h/sortable-container {}
|
||||||
[:*
|
|
||||||
(when (empty? token-sets)
|
(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
|
[:& add-set-button {:on-open on-open
|
||||||
:style "inline"}]])
|
:style "inline"}])
|
||||||
[:& sets-list]]])]]))
|
[:& sets-list]])]]))
|
||||||
|
|
||||||
(mf/defc tokens-tab
|
(mf/defc tokens-tab
|
||||||
[_props]
|
[_props]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue