mirror of
https://github.com/penpot/penpot.git
synced 2025-01-26 00:19:07 -05:00
⚡ Delimit rendering of components when they are visible on workspace assets tab
This commit is contained in:
parent
1e2603f1f5
commit
8a4fcc1d10
1 changed files with 6 additions and 2 deletions
|
@ -25,6 +25,7 @@
|
|||
[app.main.ui.components.file-uploader :refer [file-uploader]]
|
||||
[app.main.ui.components.radio-buttons :refer [radio-button radio-buttons]]
|
||||
[app.main.ui.context :as ctx]
|
||||
[app.main.ui.hooks :as h]
|
||||
[app.main.ui.icons :as i]
|
||||
[app.main.ui.workspace.sidebar.assets.common :as cmm]
|
||||
[app.main.ui.workspace.sidebar.assets.groups :as grp]
|
||||
|
@ -65,6 +66,8 @@
|
|||
new-css-system (mf/use-ctx ctx/new-css-system)
|
||||
component-id (:id component)
|
||||
|
||||
visible? (h/use-visible item-ref :once? true)
|
||||
|
||||
;; NOTE: we don't use reactive deref for it because we don't
|
||||
;; really need rerender on any change on the file change. If
|
||||
;; the component changes, it will trigger rerender anyway.
|
||||
|
@ -180,8 +183,9 @@
|
|||
(when (and (some? root-shape)
|
||||
(some? container))
|
||||
[:*
|
||||
[:& component-svg {:root-shape root-shape
|
||||
:objects (:objects container)}]
|
||||
(when visible?
|
||||
[:& component-svg {:root-shape root-shape
|
||||
:objects (:objects container)}])
|
||||
(let [renaming? (= renaming (:id component))]
|
||||
[:*
|
||||
[:& editable-label
|
||||
|
|
Loading…
Add table
Reference in a new issue