Merge pull request #4322 from penpot/eva-fix-layer-color

🐛 Fix component layer color
This commit is contained in:
Alejandro 2024-03-26 07:26:31 +01:00 committed by GitHub
commit e4c8d09e9c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View file

@ -9,6 +9,7 @@
(:require (:require
[app.common.data :as d] [app.common.data :as d]
[app.common.data.macros :as dm] [app.common.data.macros :as dm]
[app.common.types.component :as ctk]
[app.main.data.viewer :as dv] [app.main.data.viewer :as dv]
[app.main.store :as st] [app.main.store :as st]
[app.main.ui.workspace.sidebar.layer-item :refer [layer-item-inner]] [app.main.ui.workspace.sidebar.layer-item :refer [layer-item-inner]]
@ -30,7 +31,7 @@
item-ref (mf/use-ref nil) item-ref (mf/use-ref nil)
depth (+ depth 1) depth (+ depth 1)
component-tree? (or component-child? (:component-root item)) component-tree? (or component-child? (ctk/instance-root? item) (ctk/instance-head? item))
collapsed-iref collapsed-iref
(mf/use-memo (mf/use-memo

View file

@ -10,6 +10,7 @@
[app.common.data :as d] [app.common.data :as d]
[app.common.data.macros :as dm] [app.common.data.macros :as dm]
[app.common.files.helpers :as cfh] [app.common.files.helpers :as cfh]
[app.common.types.component :as ctk]
[app.common.types.container :as ctn] [app.common.types.container :as ctn]
[app.common.types.shape.layout :as ctl] [app.common.types.shape.layout :as ctl]
[app.common.uuid :as uuid] [app.common.uuid :as uuid]
@ -61,7 +62,7 @@
:class (stl/css-case :class (stl/css-case
:layer-row true :layer-row true
:highlight highlighted? :highlight highlighted?
:component (some? (:component-id item)) :component (ctk/instance-head? item)
:masked (:masked-group item) :masked (:masked-group item)
:selected selected? :selected selected?
:type-frame (cfh/frame-shape? item) :type-frame (cfh/frame-shape? item)
@ -321,7 +322,7 @@
ref (mf/use-ref) ref (mf/use-ref)
depth (+ depth 1) depth (+ depth 1)
component-tree? (or component-child? (:component-root item)) component-tree? (or component-child? (ctk/instance-root? item) (ctk/instance-head? item))
enable-drag (mf/use-fn #(reset! drag-disabled* false)) enable-drag (mf/use-fn #(reset! drag-disabled* false))
disable-drag (mf/use-fn #(reset! drag-disabled* true))] disable-drag (mf/use-fn #(reset! drag-disabled* true))]