mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-08-29 01:35:39 -04:00
Replace keyboard system with TanStack Hotkeys and jotai atoms
Remove react-hotkeys-hook, KeyboardProvider context, useRegisterShortcut wrapper, and KeyboardHelpDialog component. Components now call TanStack useHotkey/useHotkeySequence directly. Shared state uses jotai atoms in lib/atoms/, shortcut metadata lives as a static const in lib/constants/. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
"use client";
|
||||
|
||||
import { IconLogout, IconSearch, IconSettings } from "@tabler/icons-react";
|
||||
import { useSetAtom } from "jotai";
|
||||
import { motion } from "motion/react";
|
||||
import Link from "next/link";
|
||||
import { usePathname, useRouter } from "next/navigation";
|
||||
import { useKeyboard } from "@/components/keyboard-provider";
|
||||
import { SofaLogo } from "@/components/sofa-logo";
|
||||
import { Kbd } from "@/components/ui/kbd";
|
||||
import { commandPaletteOpenAtom } from "@/lib/atoms/command-palette";
|
||||
import { signOut, useSession } from "@/lib/auth/client";
|
||||
|
||||
const navLinks = [
|
||||
@@ -18,7 +19,7 @@ export function NavBar() {
|
||||
const { data: session } = useSession();
|
||||
const router = useRouter();
|
||||
const pathname = usePathname();
|
||||
const { setCommandPaletteOpen } = useKeyboard();
|
||||
const setCommandPaletteOpen = useSetAtom(commandPaletteOpenAtom);
|
||||
|
||||
return (
|
||||
<header className="sticky top-0 z-50 border-b border-border/50 bg-background/80 backdrop-blur-xl">
|
||||
|
||||
Reference in New Issue
Block a user