mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-23 09:51:10 +01:00
Dropdown manages hotkeys now
This commit is contained in:
@@ -2,7 +2,6 @@ import { invoke, shell } from '@tauri-apps/api';
|
||||
import { useRef } from 'react';
|
||||
import { useAppVersion } from '../hooks/useAppVersion';
|
||||
import { useExportData } from '../hooks/useExportData';
|
||||
import { useHotkey } from '../hooks/useHotkey';
|
||||
import { useImportData } from '../hooks/useImportData';
|
||||
import { useTheme } from '../hooks/useTheme';
|
||||
import { useUpdateMode } from '../hooks/useUpdateMode';
|
||||
@@ -24,17 +23,6 @@ export function SettingsDropdown() {
|
||||
const dropdownRef = useRef<DropdownRef>(null);
|
||||
const dialog = useDialog();
|
||||
|
||||
const showHotkeyHelp = () => {
|
||||
dialog.show({
|
||||
id: 'hotkey-help',
|
||||
title: 'Keyboard Shortcuts',
|
||||
size: 'sm',
|
||||
render: () => <KeyboardShortcutsDialog />,
|
||||
});
|
||||
};
|
||||
|
||||
useHotkey('hotkeys.showHelp', showHotkeyHelp);
|
||||
|
||||
return (
|
||||
<Dropdown
|
||||
ref={dropdownRef}
|
||||
@@ -83,7 +71,14 @@ export function SettingsDropdown() {
|
||||
key: 'hotkeys',
|
||||
label: 'Keyboard shortcuts',
|
||||
hotkeyAction: 'hotkeys.showHelp',
|
||||
onSelect: showHotkeyHelp,
|
||||
onSelect: () => {
|
||||
dialog.show({
|
||||
id: 'hotkey-help',
|
||||
title: 'Keyboard Shortcuts',
|
||||
size: 'sm',
|
||||
render: () => <KeyboardShortcutsDialog />,
|
||||
});
|
||||
},
|
||||
leftSlot: <Icon icon="keyboard" />,
|
||||
},
|
||||
{ type: 'separator', label: `Yaak v${appVersion.data}` },
|
||||
|
||||
Reference in New Issue
Block a user