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
Update selected item color in Pass menu
[ProtonMail-WebClient.git]
/
packages
/
pass
/
hooks
/
useSaveShortcut.ts
blob
990b03edb2606c1d1aac372094758b3253097186
1
import { useKeyPress } from '@proton/components';
2
3
export const useSaveShortcut = (onSave: () => void) => {
4
useKeyPress(
5
(evt) => {
6
if ((evt.ctrlKey || evt.metaKey) && evt.key === 's') {
7
evt.preventDefault();
8
onSave();
9
}
10
},
11
[onSave]
12
);
13
};