0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-23 23:35:58 -05:00

Merge pull request #5554 from penpot/eva-fix-token-status-icon

🐛  Fix token status icon id
This commit is contained in:
Andrey Antukh 2025-01-10 16:02:26 +01:00 committed by GitHub
commit ff4f0ca1d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -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}]]))

View file

@ -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)}]
```