feat(editor): add hot key and update function

This commit is contained in:
2024-01-04 10:44:00 +07:00
parent f4cbcee8b4
commit fcde669685
6 changed files with 90 additions and 13 deletions

View File

@@ -11,11 +11,13 @@ import {
} from "@lume/icons";
import { cn, editorAtom } from "@lume/utils";
import { useSetAtom } from "jotai";
import { useHotkeys } from "react-hotkeys-hook";
import { NavLink } from "react-router-dom";
import { ActiveAccount } from "./account/active";
export function Navigation() {
const setIsEditorOpen = useSetAtom(editorAtom);
useHotkeys("meta+n", () => setIsEditorOpen((state) => !state), []);
return (
<div className="flex flex-col justify-between w-20 h-full px-4 py-3 shrink-0">