mirror of
https://github.com/penpot/penpot.git
synced 2025-02-10 00:58:26 -05:00
♻️ Replace wrap-memo with memo.
This commit is contained in:
parent
6ba4531d18
commit
c907126b60
10 changed files with 16 additions and 16 deletions
|
@ -35,7 +35,7 @@
|
|||
(str (t locale "ds.updated-at" time))))
|
||||
|
||||
(mf/defc grid-item
|
||||
{:wrap [mf/wrap-memo]}
|
||||
{:wrap [mf/memo]}
|
||||
[{:keys [file] :as props}]
|
||||
(let [local (mf/use-state {:menu-open false
|
||||
:edition false})
|
||||
|
|
|
@ -78,7 +78,7 @@
|
|||
children]]])))
|
||||
|
||||
(mf/defc frame-svg
|
||||
{::mf/wrap [mf/wrap-memo]}
|
||||
{::mf/wrap [mf/memo]}
|
||||
[{:keys [objects frame zoom] :or {zoom 1} :as props}]
|
||||
(let [childs (mapv #(get objects %) (:shapes frame))
|
||||
modifier (-> (gpt/point (:x frame) (:y frame))
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
(l/derive refs/workspace-data)))
|
||||
|
||||
(mf/defc grid
|
||||
{:wrap [mf/wrap-memo]}
|
||||
{:wrap [mf/memo]}
|
||||
[props]
|
||||
(prn "grid$render")
|
||||
(let [options (mf/deref options-iref)
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
;; --- Zoom Widget
|
||||
|
||||
(mf/defc zoom-widget
|
||||
{:wrap [mf/wrap-memo]}
|
||||
{:wrap [mf/memo]}
|
||||
[props]
|
||||
(let [zoom (mf/deref refs/selected-zoom)
|
||||
show-dropdown? (mf/use-state false)
|
||||
|
|
|
@ -99,7 +99,7 @@
|
|||
;; --- Horizontal Rule Ticks (Component)
|
||||
|
||||
(mf/defc horizontal-rule-ticks
|
||||
{:wrap [mf/wrap-memo]}
|
||||
{:wrap [mf/memo]}
|
||||
[{:keys [zoom]}]
|
||||
(let [path (reduce (partial make-vertical-tick zoom) [] +ticks+)]
|
||||
[:g
|
||||
|
@ -110,7 +110,7 @@
|
|||
;; --- Vertical Rule Ticks (Component)
|
||||
|
||||
(mf/defc vertical-rule-ticks
|
||||
{:wrap [mf/wrap-memo]}
|
||||
{:wrap [mf/memo]}
|
||||
[{:keys [zoom]}]
|
||||
(let [path (reduce (partial make-horizontal-tick zoom) [] +ticks+)]
|
||||
[:g
|
||||
|
@ -121,7 +121,7 @@
|
|||
;; --- Horizontal Rule (Component)
|
||||
|
||||
(mf/defc horizontal-rule
|
||||
{:wrap [mf/wrap-memo]}
|
||||
{:wrap [mf/memo]}
|
||||
[props]
|
||||
(let [scroll (use-rxsub ms/viewport-scroll)
|
||||
zoom (mf/deref refs/selected-zoom)
|
||||
|
@ -137,7 +137,7 @@
|
|||
;; --- Vertical Rule (Component)
|
||||
|
||||
(mf/defc vertical-rule
|
||||
{:wrap [mf/wrap-memo]}
|
||||
{:wrap [mf/memo]}
|
||||
[props]
|
||||
(let [scroll (use-rxsub ms/viewport-scroll)
|
||||
zoom (or (mf/deref refs/selected-zoom) 1)
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
;; --- Left Sidebar (Component)
|
||||
|
||||
(mf/defc left-sidebar
|
||||
{:wrap [mf/wrap-memo]}
|
||||
{:wrap [mf/memo]}
|
||||
[{:keys [layout page file] :as props}]
|
||||
[:aside.settings-bar.settings-bar-left
|
||||
[:div.settings-bar-inside
|
||||
|
|
|
@ -83,7 +83,7 @@
|
|||
#(select-keys % [:id :frame :name :type :hidden :blocked]))
|
||||
|
||||
(mf/defc layer-item
|
||||
{:wrap [mf/wrap-memo]}
|
||||
{:wrap [mf/memo]}
|
||||
[{:keys [index item selected objects] :as props}]
|
||||
(let [selected? (contains? selected (:id item))
|
||||
local (mf/use-state {:collapsed false})
|
||||
|
@ -187,7 +187,7 @@
|
|||
:key (:id item)}]))])]))
|
||||
|
||||
(mf/defc layers-tree
|
||||
{::mf/wrap [mf/wrap-memo]}
|
||||
{::mf/wrap [mf/memo]}
|
||||
[props]
|
||||
(let [selected (mf/deref refs/selected-shapes)
|
||||
data (mf/deref refs/workspace-data)
|
||||
|
@ -209,7 +209,7 @@
|
|||
;; only render visible items instead of all.
|
||||
|
||||
(mf/defc layers-toolbox
|
||||
{:wrap [mf/wrap-memo]}
|
||||
{:wrap [mf/memo]}
|
||||
[{:keys [page] :as props}]
|
||||
(let [locale (i18n/use-locale)
|
||||
on-click #(st/emit! (dw/toggle-layout-flag :layers))]
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
[:& shape-options {:shape shape}]))
|
||||
|
||||
(mf/defc options-toolbox
|
||||
{:wrap [mf/wrap-memo]}
|
||||
{:wrap [mf/memo]}
|
||||
[{:keys [page selected] :as props}]
|
||||
(let [close #(st/emit! (udw/toggle-layout-flag :element-options))
|
||||
selected (mf/deref refs/selected-shapes)]
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
(l/derive refs/workspace-data)))
|
||||
|
||||
(mf/defc grid-options
|
||||
{:wrap [mf/wrap-memo]}
|
||||
{:wrap [mf/memo]}
|
||||
[props]
|
||||
(let [options (->> (mf/deref options-iref)
|
||||
(merge default-options))
|
||||
|
|
|
@ -75,7 +75,7 @@
|
|||
;; --- Selection Rect
|
||||
|
||||
(mf/defc selection-rect
|
||||
{:wrap [mf/wrap-memo]}
|
||||
{:wrap [mf/memo]}
|
||||
[{:keys [data] :as props}]
|
||||
(when data
|
||||
[:rect.selection-rect
|
||||
|
@ -119,7 +119,7 @@
|
|||
[:& frames {:data data}]))
|
||||
|
||||
(mf/defc frames
|
||||
{:wrap [mf/wrap-memo]}
|
||||
{:wrap [mf/memo]}
|
||||
[{:keys [data] :as props}]
|
||||
(let [objects (:objects data)
|
||||
root (get objects uuid/zero)
|
||||
|
|
Loading…
Add table
Reference in a new issue