mirror of
https://github.com/penpot/penpot.git
synced 2025-06-12 11:21:43 +02:00
🐛 Fix token status icon id
This commit is contained in:
parent
7c2ccb77ae
commit
cac323d6b1
2 changed files with 4 additions and 4 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue