Skip to content

Commit

Permalink
Swap hotkey
Browse files Browse the repository at this point in the history
  • Loading branch information
iower committed Oct 6, 2023
1 parent 1862cca commit 6df878b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/ui/views/Dashboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,21 @@ const Dashboard = () => {
history.push('/dex-swap');
};

// ctrl+s => open swap
const onKeyDown = (e) => {
if (e.ctrlKey && e.key === 's') {
e.preventDefault();
onClickSwap();
}
};

useEffect(() => {
document.addEventListener('keydown', onKeyDown);
return () => {
document.removeEventListener('keydown', onKeyDown);
};
}, []);

const brandIcon = useWalletConnectIcon(currentAccount);
const { t } = useTranslation();

Expand Down

0 comments on commit 6df878b

Please sign in to comment.