mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-02-25 03:54:59 +01:00
This PR finished the initial PoC command palette. It currently only supports switching between requests and workspaces, but can easily be extended for more.
19 lines
512 B
TypeScript
19 lines
512 B
TypeScript
import { CommandPalette } from '../components/CommandPalette';
|
|
import { useDialog } from '../components/DialogContext';
|
|
import { useHotKey } from './useHotKey';
|
|
|
|
export function useCommandPalette() {
|
|
const dialog = useDialog();
|
|
useHotKey('command_palette.toggle', () => {
|
|
dialog.toggle({
|
|
id: 'command_palette',
|
|
size: 'dynamic',
|
|
hideX: true,
|
|
vAlign: 'top',
|
|
noPadding: true,
|
|
noScroll: true,
|
|
render: ({ hide }) => <CommandPalette onClose={hide} />,
|
|
});
|
|
});
|
|
}
|