diff --git a/frontend/src/app/main/ui/workspace/sidebar/options.cljs b/frontend/src/app/main/ui/workspace/sidebar/options.cljs index c7413af9ac..0c6763f9ef 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options.cljs @@ -157,7 +157,7 @@ (cond (and edit-grid? (d/not-empty? selected-cells)) - [:& grid-cell/options + [:> grid-cell/options* {:shape (get objects edition) :cells selected-cells}] diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/grid_cell.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/grid_cell.cljs index 8308bae61e..3b42fd097b 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/grid_cell.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/grid_cell.cljs @@ -35,10 +35,10 @@ :justify-self :area-name]) -(mf/defc set-self-alignment - [{:keys [is-col? alignment set-alignment] :as props}] +(mf/defc set-self-alignment* + [{:keys [is-col alignment set-alignment]}] (let [alignment (or alignment :auto) - type (if is-col? "col" "row") + type (if is-col "col" "row") handle-set-alignment (mf/use-callback @@ -52,37 +52,37 @@ :allow-empty true :name (dm/str "flex-align-items-" type)} [:& radio-button {:value "start" - :icon (if is-col? + :icon (if is-col i/align-self-row-left i/align-self-column-top) :title "Align self start" :id (dm/str "align-self-start-" type)}] [:& radio-button {:value "center" - :icon (if is-col? + :icon (if is-col i/align-self-row-center i/align-self-column-center) :title "Align self center" :id (dm/str "align-self-center-" type)}] [:& radio-button {:value "end" - :icon (if is-col? + :icon (if is-col i/align-self-row-right i/align-self-column-bottom) :title "Align self end" :id (dm/str "align-self-end-" type)}] [:& radio-button {:value "stretch" - :icon (if is-col? + :icon (if is-col i/align-self-row-stretch i/align-self-column-stretch) :title "Align self stretch" :id (dm/str "align-self-stretch-" type)}]]])) -(mf/defc options +(mf/defc options* {::mf/wrap [mf/memo]} - [{:keys [shape cell cells] :as props}] + [{:keys [shape cell cells]}] (let [state* (mf/use-state {:open true}) open? (:open @state*) @@ -261,12 +261,12 @@ :value row-end}]]]]) [:div {:class (stl/css :row)} - [:& set-self-alignment {:is-col? false - :alignment align-self - :set-alignment set-alignment}] - [:& set-self-alignment {:is-col? true - :alignment justify-self - :set-alignment set-justify-self}]] + [:> set-self-alignment* {:is-col false + :alignment align-self + :set-alignment set-alignment}] + [:> set-self-alignment* {:is-col true + :alignment justify-self + :set-alignment set-justify-self}]] [:div {:class (stl/css :row)} [:button diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/shapes/bool.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/shapes/bool.cljs index b836aea6ce..2ee3489450 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/shapes/bool.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/shapes/bool.cljs @@ -102,7 +102,7 @@ :multiple false}] (when (and (= (count ids) 1) is-layout-child? is-grid-parent?) - [:& grid-cell/options + [:> grid-cell/options* {:shape (first parents) :cell (ctl/get-cell-by-shape-id (first parents) (first ids))}]) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/shapes/circle.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/shapes/circle.cljs index cf5f0cd9fa..9a440a1f56 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/shapes/circle.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/shapes/circle.cljs @@ -101,7 +101,7 @@ :multiple false}] (when (and (= (count ids) 1) is-layout-child? is-grid-parent?) - [:& grid-cell/options + [:> grid-cell/options* {:shape (first parents) :cell (ctl/get-cell-by-shape-id (first parents) (first ids))}]) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/shapes/frame.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/shapes/frame.cljs index 2948e11420..dbe0f675de 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/shapes/frame.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/shapes/frame.cljs @@ -121,7 +121,7 @@ :multiple false}] (when (and (= (count ids) 1) is-layout-child? is-grid-parent?) - [:& grid-cell/options + [:> grid-cell/options* {:shape (first parents) :cell (ctl/get-cell-by-shape-id (first parents) (first ids))}]) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/shapes/group.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/shapes/group.cljs index 6d6815da66..72c9d0443f 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/shapes/group.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/shapes/group.cljs @@ -127,7 +127,7 @@ :multiple false}] (when (and (= (count ids) 1) is-layout-child? is-grid-parent?) - [:& grid-cell/options + [:> grid-cell/options* {:shape (first parents) :cell (ctl/get-cell-by-shape-id (first parents) (first ids))}]) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/shapes/path.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/shapes/path.cljs index 79c2788d24..dff118d84e 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/shapes/path.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/shapes/path.cljs @@ -101,7 +101,7 @@ :multiple false}] (when (and (= (count ids) 1) is-layout-child? is-grid-parent?) - [:& grid-cell/options + [:> grid-cell/options* {:shape (first parents) :cell (ctl/get-cell-by-shape-id (first parents) (first ids))}]) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/shapes/rect.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/shapes/rect.cljs index ccfadbb62d..be521a8985 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/shapes/rect.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/shapes/rect.cljs @@ -101,7 +101,7 @@ :multiple false}] (when (and (= (count ids) 1) is-layout-child? is-grid-parent?) - [:& grid-cell/options + [:> grid-cell/options* {:shape (first parents) :cell (ctl/get-cell-by-shape-id (first parents) (first ids))}]) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/shapes/svg_raw.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/shapes/svg_raw.cljs index 8bb599f3ff..40a00df302 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/shapes/svg_raw.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/shapes/svg_raw.cljs @@ -168,7 +168,7 @@ :multiple false}] (when (and (= (count ids) 1) is-layout-child? is-grid-parent?) - [:& grid-cell/options + [:> grid-cell/options* {:shape (first parents) :cell (ctl/get-cell-by-shape-id (first parents) (first ids))}]) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/shapes/text.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/shapes/text.cljs index 77c0d853b4..54fe7968b8 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/shapes/text.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/shapes/text.cljs @@ -142,7 +142,7 @@ :multiple false}] (when (and (= (count ids) 1) is-layout-child? is-grid-parent?) - [:& grid-cell/options + [:> grid-cell/options* {:shape (first parents) :cell (ctl/get-cell-by-shape-id (first parents) (first ids))}])