0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-03 04:49:03 -05:00

💄 Fix indentation on shapes/bool component

This commit is contained in:
Andrey Antukh 2023-09-05 16:43:59 +02:00
parent 48e5e86b73
commit c3c2d88245

View file

@ -17,30 +17,30 @@
(defn bool-shape
[shape-wrapper]
(mf/fnc bool-shape
{::mf/wrap-props false}
[props]
(let [shape (obj/get props "shape")
childs (obj/get props "childs")
childs (use-equal-memo childs)
include-metadata? (mf/use-ctx use/include-metadata-ctx)
{::mf/wrap-props false}
[props]
(let [shape (obj/get props "shape")
childs (obj/get props "childs")
childs (use-equal-memo childs)
include-metadata? (mf/use-ctx use/include-metadata-ctx)
bool-content
(mf/use-memo
(mf/deps shape childs)
(fn []
(cond
(some? (:bool-content shape))
(:bool-content shape)
bool-content
(mf/use-memo
(mf/deps shape childs)
(fn []
(cond
(some? (:bool-content shape))
(:bool-content shape)
(some? childs)
(gsh/calc-bool-content shape childs))))]
(some? childs)
(gsh/calc-bool-content shape childs))))]
[:*
(when (some? bool-content)
[:& path-shape {:shape (assoc shape :content bool-content)}])
[:*
(when (some? bool-content)
[:& path-shape {:shape (assoc shape :content bool-content)}])
(when include-metadata?
[:> "penpot:bool" {}
(for [item (->> (:shapes shape) (mapv #(get childs %)))]
[:& shape-wrapper {:shape item
:key (dm/str (:id item))}])])])))
(when include-metadata?
[:> "penpot:bool" {}
(for [item (->> (:shapes shape) (mapv #(get childs %)))]
[:& shape-wrapper {:shape item
:key (dm/str (:id item))}])])])))