renaming/ cleaning

This commit is contained in:
Anish Roy
2023-01-14 11:35:32 +00:00
parent 5ce182a0ec
commit 1ee76fa37e
4 changed files with 6 additions and 6 deletions

View File

@@ -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"] = (

View File

@@ -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);
}}
>
<div

View File

@@ -20,7 +20,7 @@ export default function useHotKeys(actions: HotKeysAction[]) {
[actions]
);
return { handler };
return { handler } as const;
}
type KeyboardModifiers = {