0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-21 06:02:32 -05:00

Add type functions

This commit is contained in:
Florian Schroedl 2024-08-16 06:24:03 +02:00
parent cefa498f4d
commit f0aaa29d66

View file

@ -1,5 +1,27 @@
(ns app.main.ui.workspace.tokens.token-set)
;; Themes ----------------------------------------------------------------------
(defn get-theme-group [theme]
(:group theme))
(defn get-workspace-themes [state]
(get-in state [:workspace-data :token-themes] []))
(defn get-workspace-themes-index [state]
(get-in state [:workspace-data :token-themes-index] {}))
(defn get-workspace-ordered-themes [state]
(let [themes (get-workspace-themes state)
themes-index (get-workspace-themes-index state)]
(->> (map #(get themes-index (:id %)) themes)
(group-by :group))))
(defn theme-selected? [theme]
(= :enabled (:selected theme)))
;; Sets ------------------------------------------------------------------------
(defn get-workspace-tokens [state]
(get-in state [:workspace-data :tokens]))