Skip to content

Commit

Permalink
chore: simplify / remove cursor logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Tethik committed Jul 2, 2024
1 parent 78e9b81 commit 9b28a7c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
2 changes: 1 addition & 1 deletion app/src/components/model/board/shapes/ComponentLabel.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function ComponentLabel({
}}
onMouseLeave={() => {
if (!readOnly) {
document.body.style.cursor = "pointer";
document.body.style.cursor = "default";
}
}}
/>
Expand Down
18 changes: 2 additions & 16 deletions app/src/components/model/board/shapes/withComponentContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,14 @@ export default function withComponentContainer(Entity, type, includeIndicator) {

const [isHovered, setHovered] = useState();

// --------------------------------------------------------------------------
// Event handlers
// --------------------------------------------------------------------------

function onMouseEnter() {
document.body.style.cursor = "pointer";
setHovered(true);
}

function onMouseLeave() {
document.body.style.cursor = "default";
setHovered(false);
}

return (
<Group
id={id}
x={x}
y={y}
onClick={onClick}
onMouseEnter={() => onMouseEnter()}
onMouseLeave={() => onMouseLeave()}
onMouseEnter={() => setHovered(true)}
onMouseLeave={() => setHovered(false)}
onDragStart={onDragStart}
onDragMove={onDragMove}
onDragEnd={onDragEnd}
Expand Down

0 comments on commit 9b28a7c

Please sign in to comment.