mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-13 07:46:10 +00:00
Simplify conditional and fix color calculation
This commit is contained in:
parent
7e326590bb
commit
a949df25c2
@ -210,12 +210,12 @@ export const Layer = ({
|
||||
let color2 = markerDefaultColor2
|
||||
if (item.color) {
|
||||
color1 = item.color
|
||||
} else if (itemTags && itemTags[0]) {
|
||||
} else if (itemTags[0]) {
|
||||
color1 = itemTags[0].color
|
||||
}
|
||||
// What is happening here?? Why do we depend on itemColorField?
|
||||
if (itemTags && itemTags[0] && item.layer?.hasColor) color2 = itemTags[0].color
|
||||
else if (itemTags && itemTags[1]) {
|
||||
if (itemTags[0] && item.color) {
|
||||
color2 = itemTags[0].color
|
||||
} else if (itemTags[1]) {
|
||||
color2 = itemTags[1].color
|
||||
}
|
||||
return (
|
||||
|
||||
1
src/types/LayerProps.d.ts
vendored
1
src/types/LayerProps.d.ts
vendored
@ -18,7 +18,6 @@ export interface LayerProps {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
api?: ItemsApi<any>
|
||||
itemType: ItemType
|
||||
hasColor?: boolean
|
||||
onlyOnePerOwner?: boolean
|
||||
customEditLink?: string
|
||||
customEditParameter?: string
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user