Skip to content

Commit

Permalink
⚡️ :: (#28) add node function
Browse files Browse the repository at this point in the history
  • Loading branch information
KJG04 committed Jan 25, 2022
1 parent 7058cf3 commit 9355da9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions functions/src/components/LogicGate/LogicGate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ interface CurrentNode {
}

const LogicGate = () => {
const { nodes, gates } = useContext(GateContext);
const { nodes, gates, addNode } = useContext(GateContext);

useLayoutEffect(() => {
document.querySelector("html")!.style.backgroundColor = color.red;
Expand Down Expand Up @@ -102,11 +102,10 @@ const LogicGate = () => {
return;
}

// setLines([...lines, { start: currentNode.start, end: collisionDot }]);

addNode(currentNode.start.id, collisionDot.id);
setCurrentNode(null);
},
[currentNode, dots]
[addNode, currentNode, dots]
);

const drawLine = useCallback((start: Point, end: Point): string => {
Expand Down

0 comments on commit 9355da9

Please sign in to comment.