feat: add hotkeys (#986)

This commit is contained in:
Meier Lukas
2024-08-18 12:07:00 +02:00
committed by GitHub
parent 3eb90968ac
commit 7521ef0519
3 changed files with 7 additions and 2 deletions

View File

@@ -5,7 +5,7 @@ import { useCallback, useEffect } from "react";
import Link from "next/link";
import { useRouter } from "next/navigation";
import { Center, Menu, Stack, Text, useMantineColorScheme } from "@mantine/core";
import { useTimeout } from "@mantine/hooks";
import { useHotkeys, useTimeout } from "@mantine/hooks";
import {
IconCheck,
IconHome,
@@ -33,6 +33,7 @@ interface UserAvatarMenuProps {
export const UserAvatarMenu = ({ children }: UserAvatarMenuProps) => {
const t = useScopedI18n("common.userAvatar.menu");
const { colorScheme, toggleColorScheme } = useMantineColorScheme();
useHotkeys([["mod+J", toggleColorScheme]]);
const ColorSchemeIcon = colorScheme === "dark" ? IconSun : IconMoon;