Add active theme toggling

This commit is contained in:
Florian Schroedl 2024-08-19 08:05:19 +02:00
parent f0e0e9334e
commit 9a745ea8bc
7 changed files with 46 additions and 5 deletions

View file

@ -118,6 +118,16 @@
theme))
:else changes)))
(defn toggle-token-theme [token-theme-id]
(ptk/reify ::toggle-token-theme
ptk/WatchEvent
(watch [it state _]
(let [themes (wtts/get-active-theme-ids state)
new-themes (wtts/toggle-active-theme-id token-theme-id state)
changes (-> (pcb/empty-changes it)
(pcb/update-active-token-themes new-themes themes))]
(rx/of (dch/commit-changes changes))))))
(defn create-token-set [token-set]
(let [new-token-set (merge
{:id (uuid/next)