mirror of
https://github.com/penpot/penpot.git
synced 2025-08-07 14:38:33 +02:00
♻️ Remove anonym fn
This commit is contained in:
parent
325a78a967
commit
41c8bba1df
1 changed files with 24 additions and 21 deletions
|
@ -47,29 +47,32 @@
|
|||
:class (stl/css-case :check-icon true
|
||||
:check-icon-visible selected?)}]])]))
|
||||
|
||||
(defn- open-tokens-theme-modal
|
||||
[]
|
||||
(modal/show! :tokens/themes {}))
|
||||
|
||||
(mf/defc theme-options
|
||||
[{:keys [active-theme-paths themes on-close]}]
|
||||
(let [on-edit-click #(modal/show! :tokens/themes {})]
|
||||
[:ul {:class (stl/css :theme-options :custom-select-dropdown)
|
||||
:role "listbox"}
|
||||
(for [[group themes] themes]
|
||||
[:li {:key group
|
||||
:aria-labelledby (dm/str group "-label")
|
||||
:role "group"}
|
||||
(when (seq group)
|
||||
[:> text* {:as "span" :typography "headline-small" :class (stl/css :group) :id (dm/str (str/kebab group) "-label") :title group} group])
|
||||
[:& themes-list {:themes themes
|
||||
:active-theme-paths active-theme-paths
|
||||
:on-close on-close
|
||||
:grouped? true}]])
|
||||
[:li {:class (stl/css :separator)
|
||||
:aria-hidden true}]
|
||||
[:li {:class (stl/css-case :checked-element true
|
||||
:checked-element-button true)
|
||||
:role "option"
|
||||
:on-click on-edit-click}
|
||||
[:> text* {:as "span" :typography "body-small"} (tr "workspace.tokens.edit-themes")]
|
||||
[:> icon* {:icon-id i/arrow-right :aria-hidden true}]]]))
|
||||
[:ul {:class (stl/css :theme-options :custom-select-dropdown)
|
||||
:role "listbox"}
|
||||
(for [[group themes] themes]
|
||||
[:li {:key group
|
||||
:aria-labelledby (dm/str group "-label")
|
||||
:role "group"}
|
||||
(when (seq group)
|
||||
[:> text* {:as "span" :typography "headline-small" :class (stl/css :group) :id (dm/str (str/kebab group) "-label") :title group} group])
|
||||
[:& themes-list {:themes themes
|
||||
:active-theme-paths active-theme-paths
|
||||
:on-close on-close
|
||||
:grouped? true}]])
|
||||
[:li {:class (stl/css :separator)
|
||||
:aria-hidden true}]
|
||||
[:li {:class (stl/css-case :checked-element true
|
||||
:checked-element-button true)
|
||||
:role "option"
|
||||
:on-click open-tokens-theme-modal}
|
||||
[:> text* {:as "span" :typography "body-small"} (tr "workspace.tokens.edit-themes")]
|
||||
[:> icon* {:icon-id i/arrow-right :aria-hidden true}]]])
|
||||
|
||||
(mf/defc theme-select
|
||||
[{:keys []}]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue