more progress on list of users

This commit is contained in:
Arjun Patel
2022-01-31 18:25:43 -08:00
parent fcd747961c
commit 787ee9d18d
3 changed files with 46 additions and 4 deletions
@@ -0,0 +1,23 @@
import Routes from "@nirvana/common/helpers/routes";
import { useRouter } from "next/router";
import { GlobalHotKeys, KeyMap, configure } from "react-hotkeys";
configure({
ignoreTags: [],
});
export default function KeyboardShortcutHandler() {
const router = useRouter();
const handleEscape = () => {
console.log("woah");
router.push(Routes.convos);
};
const keyMap: KeyMap = {
ESCAPE: "esc",
};
const handlers = { ESCAPE: handleEscape };
return <GlobalHotKeys handlers={handlers} keyMap={keyMap} />;
}