0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-15 09:11:21 -05:00

:fix: react warning duplicate keys

This commit is contained in:
Aitor Moreno 2023-01-11 10:20:26 +01:00 committed by Alonso Torres
parent f2fd380979
commit 4b2d82e100
3 changed files with 12 additions and 9 deletions

View file

@ -113,9 +113,10 @@
{::mf/wrap-props false}
[props]
(let [childs (unchecked-get props "childs")]
(let [childs (unchecked-get props "childs")]
[:> frame-container props
[:g.frame-children
(for [item childs]
[:& shape-wrapper {:key (dm/str (:id item)) :shape item}])]])))
[:& shape-wrapper {:key (dm/str (:id item)) :shape item}]
)]])))

View file

@ -39,7 +39,7 @@
type (if (= (count shapes) 1) (-> shapes first :type) :multiple)
options (type->options type)]
[:div.element-options
(for [option options]
(for [[idx option] (map-indexed vector options)]
[:> (case option
:layout layout-panel
:layout-flex layout-flex-panel
@ -51,7 +51,8 @@
:image image-panel
:text text-panel
:svg svg-panel)
{:shapes shapes
{:key idx
:shapes shapes
:frame frame
:from from}])
[:& exports

View file

@ -106,9 +106,9 @@
[:& copy-button {:data (copy-style-data style)}]])
(when (:fills style)
(for [fill (:fills style)]
[:& color-row {:format @color-format
(for [[idx fill] (map-indexed vector (:fills style))]
[:& color-row {:key idx
:format @color-format
:color (shape->color fill)
:copy-data (copy-style-data fill :fill-color :fill-color-gradient)
:on-change-format #(reset! color-format %)}]))
@ -175,8 +175,9 @@
(remove (fn [[_ text]] (str/empty? (str/trim text))))
(mapv (fn [[style text]] (vector (merge txt/default-text-attrs style) text))))]
(for [[_ [full-style text]] (map-indexed vector style-text-blocks)]
[:& typography-block {:shape shape
(for [[idx [full-style text]] (map-indexed vector style-text-blocks)]
[:& typography-block {:key idx
:shape shape
:style full-style
:text text}])))