repo.or.cz
/
ProtonMail-WebClient.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Merge branch 'fix-typo-drive' into 'main'
[ProtonMail-WebClient.git]
/
packages
/
pass
/
hooks
/
useSearchShortcut.ts
blob
232215877847e61689e2b1e00068c2193a3c316c
1
import { useKeyPress } from '@proton/components';
2
import noop from '@proton/utils/noop';
3
4
export const useSearchShortcut = DESKTOP_BUILD
5
? (onTriggered: () => void) => {
6
useKeyPress(
7
(evt) => {
8
if ((evt.ctrlKey || evt.metaKey) && evt.key === 'f') {
9
evt.preventDefault();
10
onTriggered();
11
}
12
},
13
[onTriggered]
14
);
15
}
16
: noop;