mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
Merge pull request #5554 from penpot/eva-fix-token-status-icon
🐛 Fix token status icon id
This commit is contained in:
@@ -15,14 +15,14 @@
|
||||
(def ^:private schema:token-status-icon
|
||||
[:map
|
||||
[: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/props :obj
|
||||
::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))
|
||||
props (mf/spread-props props {:class class :width "14px" :height "14px"})
|
||||
offset 0]
|
||||
[:> "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
|
||||
[:> token-status-icon*
|
||||
{:id ts/token-status-partial
|
||||
{:icon-id ts/token-status-partial
|
||||
:class (stl/css :token-pill-icon)}]
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user