refactor: use tabs instead of spaces

This commit is contained in:
Sonny
2024-10-07 01:33:59 +02:00
parent f425decf2c
commit eea9732100
197 changed files with 5206 additions and 5209 deletions

View File

@@ -3,28 +3,28 @@ import { useHotkeys } from 'react-hotkeys-hook';
import useGlobalHotkeys from '~/hooks/use_global_hotkeys';
type ShortcutOptions = {
enabled?: boolean;
disableGlobalCheck?: boolean;
enabled?: boolean;
disableGlobalCheck?: boolean;
};
export default function useShortcut(
key: keyof typeof KEYS,
cb: () => void,
{ enabled, disableGlobalCheck }: ShortcutOptions = {
enabled: true,
disableGlobalCheck: false,
}
key: keyof typeof KEYS,
cb: () => void,
{ enabled, disableGlobalCheck }: ShortcutOptions = {
enabled: true,
disableGlobalCheck: false,
}
) {
const { globalHotkeysEnabled } = useGlobalHotkeys();
return useHotkeys(
KEYS[key],
(event) => {
event.preventDefault();
cb();
},
{
enabled: disableGlobalCheck ? enabled : enabled && globalHotkeysEnabled,
enableOnFormTags: ['INPUT'],
}
);
const { globalHotkeysEnabled } = useGlobalHotkeys();
return useHotkeys(
KEYS[key],
(event) => {
event.preventDefault();
cb();
},
{
enabled: disableGlobalCheck ? enabled : enabled && globalHotkeysEnabled,
enableOnFormTags: ['INPUT'],
}
);
}