mirror of
https://github.com/penpot/penpot.git
synced 2025-02-18 21:06:11 -05:00
✨ Fix inconsistencies on shapes/gradient component
This commit is contained in:
parent
cef74377df
commit
efd4a1ffba
1 changed files with 17 additions and 12 deletions
|
@ -101,17 +101,22 @@
|
||||||
(mf/defc gradient
|
(mf/defc gradient
|
||||||
{::mf/wrap-props false}
|
{::mf/wrap-props false}
|
||||||
[props]
|
[props]
|
||||||
(let [attr (obj/get props "attr")
|
(let [attr (unchecked-get props "attr")
|
||||||
shape (obj/get props "shape")
|
shape (unchecked-get props "shape")
|
||||||
id (obj/get props "id")
|
id (unchecked-get props "id")
|
||||||
id' (mf/use-ctx muc/render-id)
|
rid (mf/use-ctx muc/render-id)
|
||||||
id (or id (dm/str (name attr) "_" id'))
|
|
||||||
|
id (if (some? id)
|
||||||
|
id
|
||||||
|
(dm/str (name attr) "_" rid))
|
||||||
|
|
||||||
gradient (get shape attr)
|
gradient (get shape attr)
|
||||||
gradient-props #js {:id id
|
props #js {:id id
|
||||||
:gradient gradient
|
:gradient gradient
|
||||||
:shape shape}]
|
:shape shape}]
|
||||||
(when gradient
|
|
||||||
(case (d/name (:type gradient))
|
(when (some? gradient)
|
||||||
"linear" [:> linear-gradient gradient-props]
|
(case (:type gradient)
|
||||||
"radial" [:> radial-gradient gradient-props]
|
:linear [:> linear-gradient props]
|
||||||
|
:radial [:> radial-gradient props]
|
||||||
nil))))
|
nil))))
|
||||||
|
|
Loading…
Add table
Reference in a new issue