mirror of
https://github.com/penpot/penpot.git
synced 2026-05-11 02:58:25 +00:00
♻️ Migrate inspect fill/stroke deprecated blocks to modern syntax (#9392)
Signed-off-by: tmimmanuel <155203395+tmimmanuel@users.noreply.github.com> Co-authored-by: tmimmanuel <155203395+tmimmanuel@users.noreply.github.com>
This commit is contained in:
parent
ef4f57c4a1
commit
f06a2ae4e3
@ -27,8 +27,7 @@
|
||||
|
||||
;; DEPRECATED, use fill-block-styles* instead.
|
||||
;; This component is kept for backward compatibility
|
||||
(mf/defc fill-block
|
||||
{::mf/wrap-props false}
|
||||
(mf/defc fill-block*
|
||||
[{:keys [objects shape]}]
|
||||
(let [format* (mf/use-state :hex)
|
||||
format (deref format*)
|
||||
@ -84,7 +83,7 @@
|
||||
:shape shape}])
|
||||
(if (seq (:fills shape))
|
||||
(for [value (:fills shape [])]
|
||||
[:& fill-block {:key (str "fill-block-" (:id shape) value)
|
||||
:shape value}])
|
||||
[:& fill-block {:key (str "fill-block-only" (:id shape))
|
||||
:shape shape}])))]])))
|
||||
[:> fill-block* {:key (str "fill-block-" (:id shape) value)
|
||||
:shape value}])
|
||||
[:> fill-block* {:key (str "fill-block-only" (:id shape))
|
||||
:shape shape}])))]])))
|
||||
|
||||
@ -31,8 +31,7 @@
|
||||
|
||||
;; DEPRECATED, use stroke-block-styles* instead.
|
||||
;; This component is kept for backward compatibility
|
||||
(mf/defc stroke-block
|
||||
{::mf/wrap-props false}
|
||||
(mf/defc stroke-block*
|
||||
[{:keys [objects shape stroke]}]
|
||||
(let [format* (mf/use-state :hex)
|
||||
format (deref format*)
|
||||
@ -100,6 +99,6 @@
|
||||
:shape shape
|
||||
:color-space color-space
|
||||
:stroke stroke}]
|
||||
[:& stroke-block {:key (str "stroke-color-" (:id shape) stroke)
|
||||
:shape shape
|
||||
:stroke stroke}])))]])))
|
||||
[:> stroke-block* {:key (str "stroke-color-" (:id shape) stroke)
|
||||
:shape shape
|
||||
:stroke stroke}])))]])))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user