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