mirror of
https://github.com/rowyio/rowy.git
synced 2025-12-28 16:06:41 +01:00
renaming/ cleaning
This commit is contained in:
@@ -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"] = (
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -20,7 +20,7 @@ export default function useHotKeys(actions: HotKeysAction[]) {
|
||||
[actions]
|
||||
);
|
||||
|
||||
return { handler };
|
||||
return { handler } as const;
|
||||
}
|
||||
|
||||
type KeyboardModifiers = {
|
||||
Reference in New Issue
Block a user