mirror of
https://github.com/penpot/penpot.git
synced 2026-04-25 11:18:36 +00:00
♻️ Convert frame-grid and grid-options to modern * suffix
Rename grid-options -> grid-options*, frame-grid -> frame-grid*. Update internal call and call site in shapes/frame.cljs to [:> ...] syntax.
This commit is contained in:
parent
08247aec3f
commit
c1688edf66
@ -33,7 +33,7 @@
|
|||||||
:separator
|
:separator
|
||||||
18 12 10 8 6 4 3 2])
|
18 12 10 8 6 4 3 2])
|
||||||
|
|
||||||
(mf/defc grid-options
|
(mf/defc grid-options*
|
||||||
{::mf/wrap [mf/memo]}
|
{::mf/wrap [mf/memo]}
|
||||||
[{:keys [shape-id index grid frame-width frame-height default-grid-params]}]
|
[{:keys [shape-id index grid frame-width frame-height default-grid-params]}]
|
||||||
(let [on-change (mf/use-fn (mf/deps shape-id index) #(st/emit! (dw/set-frame-grid shape-id index %)))
|
(let [on-change (mf/use-fn (mf/deps shape-id index) #(st/emit! (dw/set-frame-grid shape-id index %)))
|
||||||
@ -296,7 +296,7 @@
|
|||||||
[:button {:class (stl/css :option-btn)
|
[:button {:class (stl/css :option-btn)
|
||||||
:on-click handle-set-as-default} (tr "workspace.options.grid.params.set-default")]])]])])]))
|
:on-click handle-set-as-default} (tr "workspace.options.grid.params.set-default")]])]])])]))
|
||||||
|
|
||||||
(mf/defc frame-grid
|
(mf/defc frame-grid*
|
||||||
[{:keys [shape]}]
|
[{:keys [shape]}]
|
||||||
(let [state* (mf/use-state true)
|
(let [state* (mf/use-state true)
|
||||||
open? (deref state*)
|
open? (deref state*)
|
||||||
@ -331,12 +331,12 @@
|
|||||||
(when (and open? (seq frame-grids))
|
(when (and open? (seq frame-grids))
|
||||||
[:div {:class (stl/css :element-set-content)}
|
[:div {:class (stl/css :element-set-content)}
|
||||||
(for [[index grid] (map-indexed vector frame-grids)]
|
(for [[index grid] (map-indexed vector frame-grids)]
|
||||||
[:& grid-options {:key (str id "-" index)
|
[:> grid-options* {:key (str id "-" index)
|
||||||
:shape-id id
|
:shape-id id
|
||||||
:grid grid
|
:grid grid
|
||||||
:index index
|
:index index
|
||||||
:frame-width (:width shape)
|
:frame-width (:width shape)
|
||||||
:frame-height (:height shape)
|
:frame-height (:height shape)
|
||||||
:default-grid-params default-grid-params}])])]))
|
:default-grid-params default-grid-params}])])]))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
[app.main.ui.workspace.sidebar.options.menus.constraints :refer [constraint-attrs constraints-menu*]]
|
[app.main.ui.workspace.sidebar.options.menus.constraints :refer [constraint-attrs constraints-menu*]]
|
||||||
[app.main.ui.workspace.sidebar.options.menus.exports :refer [exports-menu* exports-attrs]]
|
[app.main.ui.workspace.sidebar.options.menus.exports :refer [exports-menu* exports-attrs]]
|
||||||
[app.main.ui.workspace.sidebar.options.menus.fill :as fill]
|
[app.main.ui.workspace.sidebar.options.menus.fill :as fill]
|
||||||
[app.main.ui.workspace.sidebar.options.menus.frame-grid :refer [frame-grid]]
|
[app.main.ui.workspace.sidebar.options.menus.frame-grid :refer [frame-grid*]]
|
||||||
[app.main.ui.workspace.sidebar.options.menus.grid-cell :as grid-cell]
|
[app.main.ui.workspace.sidebar.options.menus.grid-cell :as grid-cell]
|
||||||
[app.main.ui.workspace.sidebar.options.menus.layer :refer [layer-attrs layer-menu*]]
|
[app.main.ui.workspace.sidebar.options.menus.layer :refer [layer-attrs layer-menu*]]
|
||||||
[app.main.ui.workspace.sidebar.options.menus.layout-container :refer [layout-container-flex-attrs layout-container-menu]]
|
[app.main.ui.workspace.sidebar.options.menus.layout-container :refer [layout-container-flex-attrs layout-container-menu]]
|
||||||
@ -160,7 +160,7 @@
|
|||||||
[:> shadow-menu* {:ids ids :values (get shape :shadow)}]
|
[:> shadow-menu* {:ids ids :values (get shape :shadow)}]
|
||||||
[:> blur-menu* {:ids ids
|
[:> blur-menu* {:ids ids
|
||||||
:values (select-keys shape [:blur])}]
|
:values (select-keys shape [:blur])}]
|
||||||
[:& frame-grid {:shape shape}]
|
[:> frame-grid* {:shape shape}]
|
||||||
[:> exports-menu* {:type shape-type
|
[:> exports-menu* {:type shape-type
|
||||||
:ids ids
|
:ids ids
|
||||||
:shapes shapes
|
:shapes shapes
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user