feat: 发布 0.2.8 版本
This commit is contained in:
@@ -1,33 +1,26 @@
|
||||
'use client';
|
||||
|
||||
import { motion } from 'framer-motion';
|
||||
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog';
|
||||
import { UpdateIcon } from './Icons';
|
||||
|
||||
export default function UpdatePromptModal({ updateContent, onClose, onRefresh }) {
|
||||
export default function UpdatePromptModal({ updateContent, open, onClose, onRefresh }) {
|
||||
return (
|
||||
<motion.div
|
||||
className="modal-overlay"
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-label="更新提示"
|
||||
onClick={onClose}
|
||||
initial={{ opacity: 0 }}
|
||||
animate={{ opacity: 1 }}
|
||||
exit={{ opacity: 0 }}
|
||||
style={{ zIndex: 10002 }}
|
||||
>
|
||||
<motion.div
|
||||
initial={{ opacity: 0, scale: 0.95, y: 20 }}
|
||||
animate={{ opacity: 1, scale: 1, y: 0 }}
|
||||
exit={{ opacity: 0, scale: 0.95, y: 20 }}
|
||||
className="glass card modal"
|
||||
<Dialog open={open} onOpenChange={(v) => !v && onClose?.()}>
|
||||
<DialogContent
|
||||
className="glass card"
|
||||
style={{ maxWidth: '400px' }}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
showCloseButton={false}
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-label="更新提示"
|
||||
>
|
||||
<div className="title" style={{ marginBottom: 12 }}>
|
||||
<UpdateIcon width="20" height="20" style={{ color: 'var(--success)' }} />
|
||||
<span>更新提示</span>
|
||||
</div>
|
||||
<DialogHeader>
|
||||
<DialogTitle style={{ display: 'flex', alignItems: 'center', gap: 10, marginBottom: 12 }}>
|
||||
<UpdateIcon width="20" height="20" style={{ color: 'var(--success)' }} />
|
||||
<span>更新提示</span>
|
||||
</DialogTitle>
|
||||
</DialogHeader>
|
||||
|
||||
<div style={{ marginBottom: 24 }}>
|
||||
<p className="muted" style={{ fontSize: '14px', lineHeight: '1.6', marginBottom: 12 }}>
|
||||
检测到新版本,是否刷新浏览器以更新?
|
||||
@@ -36,7 +29,7 @@ export default function UpdatePromptModal({ updateContent, onClose, onRefresh })
|
||||
</p>
|
||||
{updateContent && (
|
||||
<div style={{
|
||||
background: 'rgba(0,0,0,0.2)',
|
||||
background: 'var(--card)',
|
||||
padding: '12px',
|
||||
borderRadius: '8px',
|
||||
fontSize: '13px',
|
||||
@@ -44,13 +37,14 @@ export default function UpdatePromptModal({ updateContent, onClose, onRefresh })
|
||||
maxHeight: '200px',
|
||||
overflowY: 'auto',
|
||||
whiteSpace: 'pre-wrap',
|
||||
border: '1px solid rgba(255,255,255,0.1)'
|
||||
border: '1px solid var(--border)'
|
||||
}}>
|
||||
{updateContent}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="row" style={{ gap: 12 }}>
|
||||
|
||||
<div className="flex-row" style={{ gap: 12, display: 'flex' }}>
|
||||
<button
|
||||
className="button secondary"
|
||||
onClick={onClose}
|
||||
@@ -66,7 +60,7 @@ export default function UpdatePromptModal({ updateContent, onClose, onRefresh })
|
||||
刷新浏览器
|
||||
</button>
|
||||
</div>
|
||||
</motion.div>
|
||||
</motion.div>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user