mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-13 07:46:10 +00:00
Refactor background style
This commit is contained in:
parent
f71929b4d8
commit
aa616ed295
@ -42,6 +42,12 @@ export function ActionButton({
|
|||||||
.filter((i) => !existingRelations.some((s) => s.id === i.id))
|
.filter((i) => !existingRelations.some((s) => s.id === i.id))
|
||||||
.filter((i) => i.id !== item.id)
|
.filter((i) => i.id !== item.id)
|
||||||
|
|
||||||
|
const backgroundColor =
|
||||||
|
item.color ??
|
||||||
|
(getItemTags(item) && getItemTags(item)[0] && getItemTags(item)[0].color
|
||||||
|
? getItemTags(item)[0].color
|
||||||
|
: item.layer?.markerDefaultColor)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{hasUserPermission(collection, 'update', item) && (
|
{hasUserPermission(collection, 'update', item) && (
|
||||||
@ -55,7 +61,7 @@ export function ActionButton({
|
|||||||
setModalOpen(true)
|
setModalOpen(true)
|
||||||
}}
|
}}
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: `${(item.color ?? (getItemTags(item) && getItemTags(item)[0] && getItemTags(item)[0].color)) ? getItemTags(item)[0].color : item.layer?.markerDefaultColor}`,
|
backgroundColor,
|
||||||
color: '#fff',
|
color: '#fff',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@ -79,7 +85,7 @@ export function ActionButton({
|
|||||||
triggerAddButton()
|
triggerAddButton()
|
||||||
}}
|
}}
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: `${item.color ?? (getItemTags(item) && getItemTags(item)[0] && getItemTags(item)[0].color ? getItemTags(item)[0].color : item.layer?.markerDefaultColor)}`,
|
backgroundColor,
|
||||||
color: '#fff',
|
color: '#fff',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user