Add a keybind to open settings, CTRL + L

This commit is contained in:
ajnart
2022-05-24 23:02:27 +02:00
parent 6a14937112
commit 4f68f7e395

View File

@@ -8,7 +8,7 @@ import {
TextInput, TextInput,
Drawer, Drawer,
} from '@mantine/core'; } from '@mantine/core';
import { useColorScheme } from '@mantine/hooks'; import { useColorScheme, useHotkeys } from '@mantine/hooks';
import { useState } from 'react'; import { useState } from 'react';
import { Settings as SettingsIcon } from 'tabler-icons-react'; import { Settings as SettingsIcon } from 'tabler-icons-react';
import { useConfig } from '../../tools/state'; import { useConfig } from '../../tools/state';
@@ -97,6 +97,8 @@ function SettingsMenu(props: any) {
} }
export function SettingsMenuButton(props: any) { export function SettingsMenuButton(props: any) {
useHotkeys([['ctrl+L', () => setOpened(!opened)]]);
const [opened, setOpened] = useState(false); const [opened, setOpened] = useState(false);
return ( return (
<> <>