mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-31 14:33:18 +02:00
Remove useNavigate everywhere, and make request a query param. And convert dialog to Jotai
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
import { useCallback } from 'react';
|
||||
import { CommandPaletteDialog } from '../components/CommandPaletteDialog';
|
||||
import { useDialog } from './useDialog';
|
||||
import { toggleDialog } from '../lib/dialog';
|
||||
|
||||
export function useToggleCommandPalette() {
|
||||
const dialog = useDialog();
|
||||
const togglePalette = useCallback(() => {
|
||||
dialog.toggle({
|
||||
toggleDialog({
|
||||
id: 'command_palette',
|
||||
size: 'dynamic',
|
||||
hideX: true,
|
||||
@@ -15,7 +14,7 @@ export function useToggleCommandPalette() {
|
||||
noScroll: true,
|
||||
render: ({ hide }) => <CommandPaletteDialog onClose={hide} />,
|
||||
});
|
||||
}, [dialog]);
|
||||
}, []);
|
||||
|
||||
return togglePalette;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user