(address: string)
| 786 | // Adding New Address ------------------------------------------------------- |
| 787 | |
| 788 | function addNewAddressToCenter(address: string) { |
| 789 | // Calculate flow position of the center of the screen |
| 790 | const centerX = window.innerWidth / 2; |
| 791 | const centerY = window.innerHeight / 2; |
| 792 | const graphCenterPosition = screenToFlowPosition({ |
| 793 | x: centerX, |
| 794 | y: centerY, |
| 795 | }); |
| 796 | |
| 797 | // Add new node while accounting for the node width and height so that it's truly at the center |
| 798 | const newNode = createAddressNode( |
| 799 | address, |
| 800 | AddressNodeState.MINIMIZED, |
| 801 | true, |
| 802 | graphCenterPosition.x - 100, |
| 803 | graphCenterPosition.y - 50, |
| 804 | true, |
| 805 | ); |
| 806 | const newNodes = [...nodes, newNode]; |
| 807 | setNodes(newNodes); |
| 808 | } |
| 809 | |
| 810 | // Edge Hovering ------------------------------------------------------------ |
| 811 |
no test coverage detected