Skip to content

Commit

Permalink
Fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
smith committed May 15, 2020
1 parent f6df15d commit 247679d
Showing 1 changed file with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,12 @@ export function Popover({ focusedServiceName }: PopoverProps) {
const [selectedNode, setSelectedNode] = useState<
cytoscape.NodeSingular | undefined
>(undefined);
const deselect = useCallback(
(_event: MouseEvent<HTMLAnchorElement>) => {
if (cy) {
cy.elements().unselect();
}
setSelectedNode(undefined);
},
[cy, setSelectedNode]
);
const deselect = useCallback(() => {
if (cy) {
cy.elements().unselect();
}
setSelectedNode(undefined);
}, [cy, setSelectedNode]);
const renderedHeight = selectedNode?.renderedHeight() ?? 0;
const renderedWidth = selectedNode?.renderedWidth() ?? 0;
const { x, y } = selectedNode?.renderedPosition() ?? { x: -10000, y: -10000 };
Expand Down Expand Up @@ -118,7 +115,9 @@ export function Popover({ focusedServiceName }: PopoverProps) {
<Contents
isService={isService}
label={label}
onFocusClick={isAlreadyFocused ? centerSelectedNode : deselect}
onFocusClick={
isAlreadyFocused ? centerSelectedNode : _event => deselect()
}
selectedNodeData={selectedNodeData}
selectedNodeServiceName={selectedNodeServiceName}
/>
Expand Down

0 comments on commit 247679d

Please sign in to comment.