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

Add simple UI

This commit is contained in:
Florian Schroedl 2024-08-15 18:26:37 +02:00
parent 73078d802a
commit 587a2936e6

View file

@ -144,6 +144,29 @@
{:empty (sort-by :token-key empty)
:filled (sort-by :token-key filled)}))
(mf/defc token-sets
[_props]
(let [selected-token-set-id (mf/deref refs/workspace-selected-token-set-id)
token-sets (mf/deref refs/workspace-token-sets)]
(js/console.log "token-sets" token-sets)
[:div
{:style {:display "flex"
:flex-direction "column"
:gap "10px"}}
"Token Sets"
[:div
{:style {:display "flex" :gap "10px"}}
[:button "Create"]
[:button "Delete"]]
[:ul
{:style {:list-style "disk"
:margin-left "20px"}}
(for [[_ {:keys [id name]}] token-sets]
[:li {:style {:font-weight (when (= selected-token-set-id id) "bold")}}
name])]
[:hr]]))
(mf/defc tokens-explorer
[_props]
(let [objects (mf/deref refs/workspace-page-objects)
@ -156,6 +179,7 @@
token-groups (mf/with-memo [tokens]
(sorted-token-groups tokens))]
[:article
[:& token-sets]
[:& token-context-menu]
[:div.assets-bar
(for [{:keys [token-key token-type-props tokens]} (concat (:filled token-groups)