mirror of
https://github.com/penpot/penpot.git
synced 2026-05-25 09:53:44 +00:00
♻️ Replace local xf:add-index with d/xf:add-index in shadow menu
Signed-off-by: Andrey Antukh <niwi@niwi.nz>
This commit is contained in:
parent
727a9dcb79
commit
4e6c3b2051
@ -44,16 +44,12 @@
|
|||||||
(filterv (fn [[idx _]] (not= idx index)))
|
(filterv (fn [[idx _]] (not= idx index)))
|
||||||
(mapv second)))
|
(mapv second)))
|
||||||
|
|
||||||
(def ^:private xf:add-index
|
|
||||||
(map-indexed (fn [index shadow]
|
|
||||||
(assoc shadow ::index index))))
|
|
||||||
|
|
||||||
(mf/defc shadow-menu*
|
(mf/defc shadow-menu*
|
||||||
[{:keys [ids type values] :as props}]
|
[{:keys [ids type values] :as props}]
|
||||||
(let [shadows (mf/with-memo [values]
|
(let [shadows (mf/with-memo [values]
|
||||||
(if (= :multiple values)
|
(if (= :multiple values)
|
||||||
values
|
values
|
||||||
(not-empty (into [] xf:add-index values))))
|
(not-empty (into [] d/xf:add-index values))))
|
||||||
|
|
||||||
ids-ref (h/use-update-ref ids)
|
ids-ref (h/use-update-ref ids)
|
||||||
|
|
||||||
@ -161,7 +157,7 @@
|
|||||||
(some? shadows)
|
(some? shadows)
|
||||||
[:> h/sortable-container* {}
|
[:> h/sortable-container* {}
|
||||||
[:div {:class (stl/css :shadow-content)}
|
[:div {:class (stl/css :shadow-content)}
|
||||||
(for [{:keys [::index id] :as shadow} shadows]
|
(for [{:keys [::d/index id] :as shadow} shadows]
|
||||||
[:> shadow-row*
|
[:> shadow-row*
|
||||||
{:key (dm/str index)
|
{:key (dm/str index)
|
||||||
:index index
|
:index index
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user