From b92b006e2c22302e708672de97b9a05081ecca1c Mon Sep 17 00:00:00 2001
From: "Thomas F. K. Jorna" <thomasfkjorna@gmail.com>
Date: Fri, 6 Aug 2021 02:31:59 +0200
Subject: features!: context menu, better ui, and smoother updates

---
 components/contextmenu.tsx | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'components/contextmenu.tsx')

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>
-- 
cgit v1.2.3

