add folder-open icon and use for open groups

This commit is contained in:
Akshay Gupta 2024-08-13 19:31:34 +05:30
parent bcf61f34fe
commit fa230a4224
No known key found for this signature in database
3 changed files with 12 additions and 1 deletions

View file

@ -121,6 +121,7 @@
(def ^:icon flex (icon-xref :flex))
(def ^:icon flip-horizontal (icon-xref :flip-horizontal))
(def ^:icon flip-vertical (icon-xref :flip-vertical))
(def ^:icon folder-open (icon-xref :folder-open))
(def ^:icon gap-horizontal (icon-xref :gap-horizontal))
(def ^:icon gap-vertical (icon-xref :gap-vertical))
(def ^:icon graphics (icon-xref :graphics))

View file

@ -53,9 +53,12 @@
(let [set (get sets set-id)]
(when set
(let [{:keys [type name children]} set
icon i/document
visible? (mf/use-state (contains? active-sets set-id))
collapsed? (mf/use-state false)
icon (cond
(= type :set) i/document
(and (= type :group) @collapsed?) i/group
:else i/folder-open)
selected? (mf/use-state (= set-id current-set-id))
on-click