mirror of
https://github.com/penpot/penpot.git
synced 2026-09-09 05:28:43 +00:00
Merge pull request #5554 from penpot/eva-fix-token-status-icon
🐛 Fix token status icon id
This commit is contained in:
commit
ff4f0ca1d2
@ -15,14 +15,14 @@
|
|||||||
(def ^:private schema:token-status-icon
|
(def ^:private schema:token-status-icon
|
||||||
[:map
|
[:map
|
||||||
[:class {:optional true} :string]
|
[:class {:optional true} :string]
|
||||||
[:id [:and :string [:fn #(contains? token-status-list %)]]]])
|
[:icon-id [:and :string [:fn #(contains? token-status-list %)]]]])
|
||||||
|
|
||||||
(mf/defc token-status-icon*
|
(mf/defc token-status-icon*
|
||||||
{::mf/props :obj
|
{::mf/props :obj
|
||||||
::mf/schema schema:token-status-icon}
|
::mf/schema schema:token-status-icon}
|
||||||
[{:keys [id class] :rest props}]
|
[{:keys [icon-id class] :rest props}]
|
||||||
(let [class (dm/str (or class "") " " (stl/css :token-icon))
|
(let [class (dm/str (or class "") " " (stl/css :token-icon))
|
||||||
props (mf/spread-props props {:class class :width "14px" :height "14px"})
|
props (mf/spread-props props {:class class :width "14px" :height "14px"})
|
||||||
offset 0]
|
offset 0]
|
||||||
[:> "svg" props
|
[:> "svg" props
|
||||||
[:use {:href (dm/str "#icon-" id) :width "14px" :height "14px" :x offset :y offset}]]))
|
[:use {:href (dm/str "#icon-" icon-id) :width "14px" :height "14px" :x offset :y offset}]]))
|
||||||
|
|||||||
@ -26,6 +26,6 @@ For convenience, icons IDs are available in the component namespace.
|
|||||||
|
|
||||||
```clj
|
```clj
|
||||||
[:> token-status-icon*
|
[:> token-status-icon*
|
||||||
{:id ts/token-status-partial
|
{:icon-id ts/token-status-partial
|
||||||
:class (stl/css :token-pill-icon)}]
|
:class (stl/css :token-pill-icon)}]
|
||||||
```
|
```
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user