@@ -100,43 +100,41 @@ export default function Area({ data, onMouseDown, setResize, setInitCoords }) {
100
100
hovered
101
101
? "border-dashed border-blue-500"
102
102
: selectedElement . element === ObjectType . AREA &&
103
- selectedElement . id === data . id
104
- ? "border-blue-500"
105
- : "border-slate-400"
106
- } w-full h-full cursor-move rounded relative `}
103
+ selectedElement . id === data . id
104
+ ? "border-blue-500"
105
+ : "border-slate-400"
106
+ } w-full h-full cursor-move rounded`}
107
107
>
108
108
< div
109
- className = "opacity-40 w-fill p-2 h-full"
110
- style = { { backgroundColor : data . color } }
111
- />
112
- </ div >
113
- < div className = "text-color absolute top-2 left-3 select-none" >
114
- { data . name }
115
- </ div >
116
- { ( hovered || ( areaIsSelected ( ) && ! layout . sidebar ) ) && (
117
- < div className = "absolute top-2 right-3" >
118
- < Popover
119
- visible = { areaIsSelected ( ) && ! layout . sidebar }
120
- onClickOutSide = { onClickOutSide }
121
- stopPropagation
122
- content = { < EditPopoverContent data = { data } /> }
123
- trigger = "custom"
124
- position = "rightTop"
125
- showArrow
126
- >
127
- < Button
128
- icon = { < IconEdit /> }
129
- size = "small"
130
- theme = "solid"
131
- style = { {
132
- backgroundColor : "#2f68ad" ,
133
- opacity : "0.7" ,
134
- } }
135
- onClick = { edit }
136
- />
137
- </ Popover >
109
+ className = "w-fill p-2 h-full"
110
+ style = { { backgroundColor : `${ data . color } 66` } }
111
+ >
112
+ < div className = "flex justify-between" >
113
+ < div className = "text-color select-none" > { data . name } </ div >
114
+ { ( hovered || ( areaIsSelected ( ) && ! layout . sidebar ) ) && (
115
+ < Popover
116
+ visible = { areaIsSelected ( ) && ! layout . sidebar }
117
+ onClickOutSide = { onClickOutSide }
118
+ stopPropagation
119
+ content = { < EditPopoverContent data = { data } /> }
120
+ trigger = "custom"
121
+ position = "rightTop"
122
+ showArrow
123
+ >
124
+ < Button
125
+ icon = { < IconEdit /> }
126
+ size = "small"
127
+ theme = "solid"
128
+ style = { {
129
+ backgroundColor : "#2F68ADB3" ,
130
+ } }
131
+ onClick = { edit }
132
+ />
133
+ </ Popover >
134
+ ) }
135
+ </ div >
138
136
</ div >
139
- ) }
137
+ </ div >
140
138
</ foreignObject >
141
139
{ hovered && (
142
140
< >
0 commit comments