Update selected item color in Pass menu
[ProtonMail-WebClient.git] / packages / pass / hooks / useNewItemShortcut.ts
blobf6ec917bc825a59b50982e8e5ac2d426a23ebe0b
1 import { useKeyPress } from '@proton/components';
2 import noop from '@proton/utils/noop';
4 export const useNewItemShortcut = DESKTOP_BUILD
5     ? (onTriggered: () => void) => {
6           useKeyPress(
7               (evt) => {
8                   if ((evt.ctrlKey || evt.metaKey) && evt.key === 'n') {
9                       evt.preventDefault();
10                       onTriggered();
11                   }
12               },
13               [onTriggered]
14           );
15       }
16     : noop;