mirror of
https://github.com/penpot/penpot.git
synced 2025-06-06 08:41:38 +02:00
🔥 Remove not necessary API from tokens-lib: add-sets
This commit is contained in:
parent
802c67ace4
commit
1e10e3818e
5 changed files with 29 additions and 41 deletions
|
@ -139,7 +139,7 @@
|
|||
(let [data (dsh/lookup-file-data state)
|
||||
tokens-lib (get data :tokens-lib)
|
||||
set-name (ctob/normalize-set-name set-name)]
|
||||
(if (ctob/get-set tokens-lib set-name)
|
||||
(if (and tokens-lib (ctob/get-set tokens-lib set-name))
|
||||
(rx/of (ntf/show {:content (tr "errors.token-set-already-exists")
|
||||
:type :toast
|
||||
:level :error
|
||||
|
|
|
@ -293,11 +293,12 @@
|
|||
:on-save-form on-save-form
|
||||
:disabled? disabled?}]]]]]))
|
||||
|
||||
(defn- make-lib-with-theme [theme sets]
|
||||
(-> (ctob/make-tokens-lib)
|
||||
(ctob/add-theme theme)
|
||||
(ctob/add-sets sets)
|
||||
(ctob/activate-theme (:group theme) (:name theme))))
|
||||
(defn- make-lib-with-theme
|
||||
[theme sets]
|
||||
(let [tlib (-> (ctob/make-tokens-lib)
|
||||
(ctob/add-theme theme))
|
||||
tlib (reduce ctob/add-set tlib sets)]
|
||||
(ctob/activate-theme tlib (:group theme) (:name theme))))
|
||||
|
||||
(mf/defc controlled-edit-theme
|
||||
[{:keys [state set-state]}]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue