diff --git a/src-web/components/Sidebar.tsx b/src-web/components/Sidebar.tsx index 0f197a4b..9965656c 100644 --- a/src-web/components/Sidebar.tsx +++ b/src-web/components/Sidebar.tsx @@ -9,6 +9,7 @@ import { useUpdateAnyRequest } from '../hooks/useUpdateAnyRequest'; import { useUpdateRequest } from '../hooks/useUpdateRequest'; import type { HttpRequest } from '../lib/models'; import { Button } from './core/Button'; +import { Dialog } from './core/Dialog'; import { IconButton } from './core/IconButton'; import { HStack, VStack } from './core/Stacks'; import { DropMarker } from './DropMarker'; @@ -32,6 +33,7 @@ export const Sidebar = memo(function Sidebar({ className }: Props) { [unorderedRequests], ); + const [open, setOpen] = useState(false); return (
+ + Hello? + + setOpen(true)} />
diff --git a/src-web/components/core/Dialog.tsx b/src-web/components/core/Dialog.tsx index 81394f9a..f2712630 100644 --- a/src-web/components/core/Dialog.tsx +++ b/src-web/components/core/Dialog.tsx @@ -1,7 +1,7 @@ -import * as D from '@radix-ui/react-dialog'; import classnames from 'classnames'; import { motion } from 'framer-motion'; import type { ReactNode } from 'react'; +import { Portal } from '../Portal'; import { IconButton } from './IconButton'; import { HStack, VStack } from './Stacks'; @@ -25,11 +25,15 @@ export function Dialog({ description, }: Props) { return ( - - ('#radix-portal')}> + + {open && ( - - +
onOpenChange(false)} + className="fixed inset-0 bg-gray-600/60 dark:bg-black/50" + /> +
- - - + onOpenChange(false)} + title="Close dialog" + aria-label="Close" + icon="x" + size="sm" + className="ml-auto absolute right-1 top-1" + /> - {title} +
{title}
- {description && {description}} + {description &&
{description}
}
{children}
- +
- - + )} + ); }