diff --git a/src/components/Table/ContextMenu/BasicCellContextMenuActions.tsx b/src/components/Table/ContextMenu/BasicCellContextMenuActions.tsx index a82c6e78..25b6ce0f 100644 --- a/src/components/Table/ContextMenu/BasicCellContextMenuActions.tsx +++ b/src/components/Table/ContextMenu/BasicCellContextMenuActions.tsx @@ -2,7 +2,7 @@ import { Copy as CopyCells } from "@src/assets/icons"; // import Cut from "@mui/icons-material/ContentCut"; import Paste from "@mui/icons-material/ContentPaste"; import { IFieldConfig } from "@src/components/fields/types"; -import { useMenuAction } from "@src/contexts/TableKbShortcutContext"; +import { useMenuAction } from "@src/components/Table/useMenuAction"; // TODO: Remove this and add `handlePaste` function to column config export const BasicContextMenuActions: IFieldConfig["contextMenuActions"] = ( diff --git a/src/components/Table/Table.tsx b/src/components/Table/Table.tsx index 76d504b5..b99c1129 100644 --- a/src/components/Table/Table.tsx +++ b/src/components/Table/Table.tsx @@ -32,11 +32,11 @@ import { updateColumnAtom, selectedCellAtom, } from "@src/atoms/tableScope"; -import { useMenuAction } from "@src/contexts/TableKbShortcutContext"; import { getFieldType, getFieldProp } from "@src/components/fields"; import { useKeyboardNavigation } from "./useKeyboardNavigation"; +import { useMenuAction } from "./useMenuAction"; import { useSaveColumnSizing } from "./useSaveColumnSizing"; -import useHotKeys from "./useHotKeys"; +import useHotKeys from "./useHotKey"; import type { TableRow, ColumnConfig } from "@src/types/table"; export const DEFAULT_ROW_HEIGHT = 41; @@ -186,7 +186,7 @@ export default function Table({ }); const [selectedCell] = useAtom(selectedCellAtom, tableScope); const { handleCopy, handlePaste, handleCut } = useMenuAction(selectedCell); - const { handler } = useHotKeys([ + const { handler: hotKeysHandler } = useHotKeys([ ["mod+C", handleCopy], ["mod+X", handleCut], ["mod+V", handlePaste], @@ -254,7 +254,7 @@ export default function Table({ } onKeyDown={(e) => { handleKeyDown(e); - handler(e); + hotKeysHandler(e); }} >