summaryrefslogtreecommitdiff
path: root/components/contextmenu.tsx
diff options
context:
space:
mode:
authorThomas F. K. Jorna <[email protected]>2021-08-06 02:31:59 +0200
committerThomas F. K. Jorna <[email protected]>2021-08-06 02:31:59 +0200
commitb92b006e2c22302e708672de97b9a05081ecca1c (patch)
tree7117eee455b6b8e4b60e4265e36f258a3a360f73 /components/contextmenu.tsx
parentd1a7d3c00a603cb774697e49696e9a0d2c4661b9 (diff)
features!: context menu, better ui, and smoother updates
Diffstat (limited to 'components/contextmenu.tsx')
-rw-r--r--components/contextmenu.tsx6
1 files changed, 5 insertions, 1 deletions
diff --git a/components/contextmenu.tsx b/components/contextmenu.tsx
index 228a780..755bd9d 100644
--- a/components/contextmenu.tsx
+++ b/components/contextmenu.tsx
@@ -54,6 +54,7 @@ export default interface ContextMenuProps {
menuClose: () => void
scope: { nodeIds: string[] }
deleteNodeInEmacs: (node: OrgRoamNode) => void
+ createNodeInEmacs: (node: OrgRoamNode) => void
}
export const ContextMenu = (props: ContextMenuProps) => {
@@ -67,6 +68,7 @@ export const ContextMenu = (props: ContextMenuProps) => {
scope,
openNodeInEmacs,
deleteNodeInEmacs,
+ createNodeInEmacs,
} = props
const { isOpen, onOpen, onClose } = useDisclosure()
const copyRef = useRef<any>()
@@ -104,7 +106,9 @@ export const ContextMenu = (props: ContextMenuProps) => {
Open in Emacs
</MenuItem>
) : (
- <MenuItem icon={<AddIcon />}>Create node</MenuItem>
+ <MenuItem icon={<AddIcon />} onClick={() => createNodeInEmacs(node)}>
+ Create node
+ </MenuItem>
)}
{node?.properties.ROAM_REFS && (
<MenuItem icon={<ExternalLinkIcon />}>Open in Zotero</MenuItem>