0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-23 07:16:07 -05:00

Merge pull request #3572 from penpot/eva-fix-layer-name-viewer

🐛 Fix layer name on viewer
This commit is contained in:
Alejandro 2023-08-29 14:18:10 +02:00 committed by GitHub
commit 266e1c7142
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,6 +7,7 @@
(ns app.main.ui.viewer.inspect.left-sidebar (ns app.main.ui.viewer.inspect.left-sidebar
(:require (:require
[app.common.data :as d] [app.common.data :as d]
[app.common.pages.helpers :as cph]
[app.common.types.shape.layout :as ctl] [app.common.types.shape.layout :as ctl]
[app.main.data.viewer :as dv] [app.main.data.viewer :as dv]
[app.main.store :as st] [app.main.store :as st]
@ -26,6 +27,9 @@
(mf/defc layer-item (mf/defc layer-item
[{:keys [item selected objects disable-collapse?] :as props}] [{:keys [item selected objects disable-collapse?] :as props}]
(let [id (:id item) (let [id (:id item)
name (:name item)
hidden? (:hidden item)
touched? (-> item :touched seq boolean)
selected? (contains? selected id) selected? (contains? selected id)
item-ref (mf/use-ref nil) item-ref (mf/use-ref nil)
@ -74,7 +78,13 @@
(when absolute? (when absolute?
[:div.absolute i/position-absolute]) [:div.absolute i/position-absolute])
[:& si/element-icon {:shape item}]] [:& si/element-icon {:shape item}]]
[:& layer-name {:shape item :disabled-double-click true}] [:& layer-name {:shape-id id
:shape-name name
:shape-touched? touched?
:hidden? hidden?
:selected? selected?
:type-frame (cph/frame-shape? item)
:disabled-double-click true}]
(when (and (not disable-collapse?) (:shapes item)) (when (and (not disable-collapse?) (:shapes item))
[:span.toggle-content [:span.toggle-content