diff --git a/packages/ui/app/_components/dialogs/loop/index.tsx b/packages/ui/app/_components/dialogs/loop/index.tsx index 4642de872..ad5fc289a 100644 --- a/packages/ui/app/_components/dialogs/loop/index.tsx +++ b/packages/ui/app/_components/dialogs/loop/index.tsx @@ -586,7 +586,11 @@ export default function Loop({ open={isOpen} onOpenChange={setIsOpen} > - +
diff --git a/packages/ui/app/_components/dialogs/manage/index.tsx b/packages/ui/app/_components/dialogs/manage/index.tsx index d06f3efbe..12a4cbb23 100644 --- a/packages/ui/app/_components/dialogs/manage/index.tsx +++ b/packages/ui/app/_components/dialogs/manage/index.tsx @@ -176,7 +176,11 @@ const ManageDialog = ({ open={isOpen} onOpenChange={setIsOpen} > - +
modlogo { + hideCloseButton?: boolean; + size?: DialogSize; + minWidth?: string; + maxWidth?: string; + fullWidth?: boolean; +} + +const DialogContent = React.forwardRef< + React.ElementRef, + DialogContentProps +>( + ( + { + className, + children, + hideCloseButton = false, + size = '2xl', + minWidth, + maxWidth, + fullWidth = false, + style, + ...props + }, + ref + ) => { + // Build the style object with min and max width + const combinedStyle = React.useMemo( + () => ({ + ...style, + ...(minWidth && { minWidth }), + ...(maxWidth && { maxWidth }), + width: fullWidth ? '100%' : undefined + }), + [style, minWidth, maxWidth, fullWidth] + ); + + // Get the base size class + const getSizeClass = () => { + if (size in dialogSizeVariants) { + return dialogSizeVariants[size as keyof typeof dialogSizeVariants]; + } + if (size in dialogSizeVariants.percentage) { + return dialogSizeVariants.percentage[ + size as keyof typeof dialogSizeVariants.percentage + ]; + } + return dialogSizeVariants['2xl']; + }; + + return ( + + + + {children} + {!hideCloseButton && ( + + + Close + + )} + + + ); + } +); +DialogContent.displayName = DialogPrimitive.Content.displayName; + const Dialog = DialogPrimitive.Root; const DialogTrigger = DialogPrimitive.Trigger; const DialogPortal = DialogPrimitive.Portal; @@ -24,38 +124,7 @@ const DialogOverlay = React.forwardRef< /> )); DialogOverlay.displayName = DialogPrimitive.Overlay.displayName; - -interface DialogContentProps - extends React.ComponentPropsWithoutRef { - hideCloseButton?: boolean; -} - -const DialogContent = React.forwardRef< - React.ElementRef, - DialogContentProps ->(({ className, children, hideCloseButton = false, ...props }, ref) => ( - - - - {children} - {!hideCloseButton && ( - - - Close - - )} - - -)); -DialogContent.displayName = DialogPrimitive.Content.displayName; - +// Rest of the components remain unchanged const DialogHeader = ({ className, ...props @@ -85,7 +154,6 @@ const DialogTitle = React.forwardRef< )); DialogTitle.displayName = DialogPrimitive.Title.displayName; -// Rest of the components remain unchanged const DialogFooter = ({ className, ...props @@ -113,6 +181,7 @@ const DialogDescription = React.forwardRef< DialogDescription.displayName = DialogPrimitive.Description.displayName; export { + type DialogSize, Dialog, DialogPortal, DialogOverlay,