diff --git a/app/web/src/components/EditorMenu/AllShortcutsModal.tsx b/app/web/src/components/EditorMenu/AllShortcutsModal.tsx index c37d3f1..5af3486 100644 --- a/app/web/src/components/EditorMenu/AllShortcutsModal.tsx +++ b/app/web/src/components/EditorMenu/AllShortcutsModal.tsx @@ -21,7 +21,7 @@ const AllShortcutsModal = () => { ) diff --git a/app/web/src/components/EditorMenu/Dropdowns.tsx b/app/web/src/components/EditorMenu/Dropdowns.tsx new file mode 100644 index 0000000..4672635 --- /dev/null +++ b/app/web/src/components/EditorMenu/Dropdowns.tsx @@ -0,0 +1,49 @@ +import { Menu } from '@headlessui/react' +import { useHotkeys } from 'react-hotkeys-hook'; + +export function DropdownItem({ config, state, thunkDispatch }) { + console.log({ name: config.label, shortcut: config.shortcut, callback: handleClick}) + useHotkeys(config.shortcut, handleClick) + + function handleClick(e) { + console.log(e, config) + e.preventDefault() + config.callback(e, {state, thunkDispatch}) + } + return ( +