Improves dialog appearance and backdrop behavior

Unifies custom box shadow styling for modal dialogs to enhance visual consistency.

Adds backdrop click handlers to dialog overlays, enabling users to dismiss dialogs by clicking outside the content area, while preventing accidental closure when interacting with the dialog itself.
This commit is contained in:
bincxz committed 2025-12-11 04:48:47 +08:00
1 parent 101c086eef
commit a67983dc3c
3 files changed
+6 -5

No files matched your search

+2 -2
View File
@@ -110,8 +110,8 @@ const ProtocolSelectDialog: React.FC<ProtocolSelectDialogProps> = ({
}, [protocolOptions]);
return (
<div className="fixed inset-0 z-50 flex items-center justify-center">
<div className="w-[560px] max-w-[90vw] bg-background border border-border rounded-2xl shadow-2xl animate-in fade-in-0 zoom-in-95 duration-200">
<div className="fixed inset-0 z-50 flex items-center justify-center" onClick={onCancel}>
<div className="w-[560px] max-w-[90vw] bg-background border border-border rounded-2xl animate-in fade-in-0 zoom-in-95 duration-200" style={{ boxShadow: '0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 12px 24px -8px rgba(0, 0, 0, 0.15)' }} onClick={(e) => e.stopPropagation()}>
{/* Header */}
<div className="px-6 py-5 border-b border-border/50">
<div className="flex items-center gap-3">
+2 -2
View File
@@ -603,8 +603,8 @@ const QuickConnectWizard: React.FC<QuickConnectWizardProps> = ({
};
return (
<div className="fixed inset-0 z-50 flex items-center justify-center">
<div className="w-[560px] max-w-[90vw] bg-background border border-border rounded-2xl shadow-2xl animate-in fade-in-0 zoom-in-95 duration-200">
<div className="fixed inset-0 z-50 flex items-center justify-center" onClick={onClose}>
<div className="w-[560px] max-w-[90vw] bg-background border border-border rounded-2xl animate-in fade-in-0 zoom-in-95 duration-200" style={{ boxShadow: '0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 12px 24px -8px rgba(0, 0, 0, 0.15)' }} onClick={(e) => e.stopPropagation()}>
{/* Header */}
<div className="px-6 py-5 border-b border-border/50">
<div className="flex items-center justify-between">
+2 -1
View File
@@ -36,9 +36,10 @@ const DialogContent = React.forwardRef<
<DialogPrimitive.Content
ref={ref}
className={cn(
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
className
)}
style={{ boxShadow: '0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 12px 24px -8px rgba(0, 0, 0, 0.15)' }}
{...props}
>
{children}