Files
MyGoNavi/frontend/src/components/SecurityUpdateProgressModal.tsx
Syngnat 93bb164004 🐛 fix(modal): 统一浮层层级并修复设置窗口遮挡
- 统一主窗口、原生分离窗口和静态 API 的 Ant Design 浮层基线
- 提升更新、导出、安全更新与连接代理子弹窗层级
- 将业务 Modal 接入统一封装并修复命令面板 stacking context
- 增加浮层策略、设置流程和 Modal 导入守卫测试
2026-07-22 15:37:20 +08:00

78 lines
2.2 KiB
TypeScript

import Modal from './common/ResizableDraggableModal';
import { Spin } from 'antd';
import { SafetyCertificateOutlined } from '@ant-design/icons';
import type { OverlayWorkbenchTheme } from '../utils/overlayWorkbenchTheme';
import {
SECURITY_UPDATE_MODAL_CLASS,
getSecurityUpdateShellSurfaceStyle,
} from '../utils/securityUpdateVisuals';
import { useI18n } from '../i18n/provider';
import { APP_NESTED_MODAL_Z_INDEX } from '../utils/overlayZIndex';
interface SecurityUpdateProgressModalProps {
open: boolean;
zIndex?: number;
stageText: string;
detailText?: string;
overlayTheme: OverlayWorkbenchTheme;
surfaceOpacity?: number;
}
const SecurityUpdateProgressModal = ({
open,
zIndex = APP_NESTED_MODAL_Z_INDEX,
stageText,
detailText,
overlayTheme,
surfaceOpacity = 1,
}: SecurityUpdateProgressModalProps) => {
const { t } = useI18n();
return (
<Modal
rootClassName={SECURITY_UPDATE_MODAL_CLASS}
open={open}
zIndex={zIndex}
closable={false}
maskClosable={false}
keyboard={false}
footer={null}
width={420}
centered
styles={{
content: getSecurityUpdateShellSurfaceStyle(overlayTheme, surfaceOpacity),
header: { display: 'none' },
body: { padding: 28 },
}}
>
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', textAlign: 'center', gap: 16 }}>
<div
style={{
width: 52,
height: 52,
borderRadius: 18,
display: 'grid',
placeItems: 'center',
background: overlayTheme.iconBg,
color: overlayTheme.iconColor,
fontSize: 22,
}}
>
<SafetyCertificateOutlined />
</div>
<div style={{ fontSize: 16, fontWeight: 700, color: overlayTheme.titleText }}>
{stageText}
</div>
<div style={{ fontSize: 13, color: overlayTheme.mutedText, lineHeight: 1.7 }}>
{detailText ?? t('security_update.progress.default_detail')}
</div>
<Spin size="large" />
</div>
</Modal>
);
};
export type { SecurityUpdateProgressModalProps };
export default SecurityUpdateProgressModal;