New MenuItem components (#1389)

* wip

* Finished

* Fix from review

* Fix lint

* Fixed toggle
This commit is contained in:
Lucas Bordeau
2023-09-01 11:35:19 +02:00
committed by GitHub
parent 2538ad1c6b
commit 240edda25c
20 changed files with 933 additions and 39 deletions

View File

@ -0,0 +1,19 @@
import { Keys } from 'react-hotkeys-hook';
import { useScopedHotkeys } from '@/ui/utilities/hotkey/hooks/useScopedHotkeys';
type OwnProps = {
hotkey: {
key: Keys;
scope: string;
};
onHotkeyTriggered: () => void;
};
export function HotkeyEffect({ hotkey, onHotkeyTriggered }: OwnProps) {
useScopedHotkeys(hotkey.key, () => onHotkeyTriggered(), hotkey.scope, [
onHotkeyTriggered,
]);
return <></>;
}