summaryrefslogtreecommitdiff
path: root/pages/index.tsx
diff options
context:
space:
mode:
authorThomas F. K. Jorna <[email protected]>2021-10-11 01:27:47 +0200
committerThomas F. K. Jorna <[email protected]>2021-10-11 01:27:47 +0200
commitbb6fe7325dfe76c0618d34455e56122c3204a3b3 (patch)
tree63585e12385dfa5c7501f03646cb2a88cb43a0da /pages/index.tsx
parent546a88ec37073840e98ed689f7139d04985e861c (diff)
chore: build
Diffstat (limited to 'pages/index.tsx')
-rw-r--r--pages/index.tsx11
1 files changed, 9 insertions, 2 deletions
diff --git a/pages/index.tsx b/pages/index.tsx
index c80fc50..5b07039 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -461,7 +461,13 @@ export function GraphPage() {
const contextMenuRef = useRef<any>()
const [contextMenuTarget, setContextMenuTarget] = useState<OrgRoamNode | null>(null)
- const [contextPos, setContextPos] = useState({
+ type ContextPos = {
+ left: number | undefined
+ right: number | undefined
+ top: number | undefined
+ bottom: number | undefined
+ }
+ const [contextPos, setContextPos] = useState<ContextPos>({
left: 0,
top: 0,
right: undefined,
@@ -477,7 +483,7 @@ export function GraphPage() {
},
})
- const openContextMenu = (node: OrgRoamNode, event: any, coords?: number[]) => {
+ const openContextMenu = (node: OrgRoamNode, event: any, coords?: ContextPos) => {
coords
? setContextPos(coords)
: setContextPos({ left: event.pageX, top: event.pageY, right: undefined, bottom: undefined })
@@ -568,6 +574,7 @@ export function GraphPage() {
handleLocal,
mainWindowWidth,
setMainWindowWidth,
+ setContextMenuTarget,
}}
/>
</Box>