Revert "fix: 弹框居中写法调整,增强兼容性"

This reverts commit 5293a32748.
This commit is contained in:
hzm
2026-03-11 14:13:09 +08:00
parent efe61a825a
commit 8c55e97d9c
2 changed files with 28 additions and 21 deletions

View File

@@ -34,7 +34,7 @@ import {
DialogHeader, DialogHeader,
DialogTitle, DialogTitle,
} from '@/components/ui/dialog'; } from '@/components/ui/dialog';
import { DragIcon, ExitIcon, SettingsIcon, StarIcon, TrashIcon, ResetIcon } from './Icons'; import { CloseIcon, DragIcon, ExitIcon, SettingsIcon, StarIcon, TrashIcon, ResetIcon } from './Icons';
const NON_FROZEN_COLUMN_IDS = [ const NON_FROZEN_COLUMN_IDS = [
'yesterdayChangePercent', 'yesterdayChangePercent',
@@ -1167,13 +1167,22 @@ export default function PcFundTable({
> >
<DialogContent <DialogContent
className="sm:max-w-2xl max-h-[88vh] flex flex-col p-0 overflow-hidden" className="sm:max-w-2xl max-h-[88vh] flex flex-col p-0 overflow-hidden"
showCloseButton showCloseButton={false}
onPointerDownOutside={blockDialogClose ? (e) => e.preventDefault() : undefined} onPointerDownOutside={blockDialogClose ? (e) => e.preventDefault() : undefined}
> >
<DialogHeader className="flex-shrink-0 flex flex-row items-center justify-between gap-2 space-y-0 px-6 pb-4 pt-6 text-left border-b border-[var(--border)]"> <DialogHeader className="flex-shrink-0 flex flex-row items-center justify-between gap-2 space-y-0 px-6 pb-4 pt-6 text-left border-b border-[var(--border)]">
<DialogTitle className="text-base font-semibold text-[var(--text)]"> <DialogTitle className="text-base font-semibold text-[var(--text)]">
基金详情 基金详情
</DialogTitle> </DialogTitle>
<button
type="button"
className="icon-button rounded-lg"
aria-label="关闭"
onClick={() => setCardDialogRow(null)}
style={{ padding: 4, borderColor: 'transparent' }}
>
<CloseIcon width="20" height="20" />
</button>
</DialogHeader> </DialogHeader>
<div <div
className="flex-1 min-h-0 overflow-y-auto px-6 py-4" className="flex-1 min-h-0 overflow-y-auto px-6 py-4"

View File

@@ -56,11 +56,10 @@ function DialogContent({
return ( return (
<DialogPortal data-slot="dialog-portal"> <DialogPortal data-slot="dialog-portal">
<DialogOverlay className={overlayClassName} style={overlayStyle} /> <DialogOverlay className={overlayClassName} style={overlayStyle} />
<div className="fixed inset-0 z-50 flex items-center justify-center p-4">
<DialogPrimitive.Content <DialogPrimitive.Content
data-slot="dialog-content" data-slot="dialog-content"
className={cn( className={cn(
"relative w-full max-w-[calc(100%-2rem)] rounded-[16px] border border-[var(--border)] text-[var(--foreground)] p-6 dialog-content-shadow outline-none duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg", "fixed top-[50%] left-[50%] z-50 w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-[16px] border border-[var(--border)] text-[var(--foreground)] p-6 dialog-content-shadow outline-none duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",
className className
)} )}
{...props}> {...props}>
@@ -74,7 +73,6 @@ function DialogContent({
</DialogPrimitive.Close> </DialogPrimitive.Close>
)} )}
</DialogPrimitive.Content> </DialogPrimitive.Content>
</div>
</DialogPortal> </DialogPortal>
); );
} }