Remove useNavigate everywhere, and make request a query param. And convert dialog to Jotai

This commit is contained in:
Gregory Schier
2025-01-06 16:54:07 -08:00
parent 806a8eb801
commit bc50891edb
54 changed files with 592 additions and 545 deletions
+2 -3
View File
@@ -1,16 +1,15 @@
import type { DialogProps } from '../components/core/Dialog';
import { showDialog } from '../lib/dialog';
import type { PromptProps } from './Prompt';
import { Prompt } from './Prompt';
import {useDialog} from "./useDialog";
type Props = Pick<DialogProps, 'title' | 'description'> &
Omit<PromptProps, 'onClose' | 'onCancel' | 'onResult'> & { id: string };
export function usePrompt() {
const dialog = useDialog();
return ({ id, title, description, ...props }: Props) =>
new Promise((resolve: PromptProps['onResult']) => {
dialog.show({
showDialog({
id,
title,
description,