feat: 版主子管理页(帖子管理/公告/禁言)+ 版块级禁言(migrations v5)
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import React from 'react';
|
||||
import { useDialog } from '../lib/utils.js';
|
||||
|
||||
/**
|
||||
* 403 等操作被拒错误弹窗(前台 MD3 风格):
|
||||
* 发帖/回复被禁言时后端返回 403 + 含到期时间的错误文案,用弹窗突出展示(snackbar 2.5s 太短)。
|
||||
* props: open / message / onClose
|
||||
*/
|
||||
export default function ErrorDialog({ open = false, message = '', onClose }) {
|
||||
const { dialogRef, onKeyDown } = useDialog(open, onClose);
|
||||
if (!open || !message) return null;
|
||||
return (
|
||||
<div
|
||||
ref={dialogRef}
|
||||
className="dialog-overlay active"
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-label="操作被拒绝"
|
||||
style={{ display: 'flex', zIndex: 9999 }}
|
||||
onMouseDown={(e) => { if (e.target === e.currentTarget && onClose) onClose(); }}
|
||||
onKeyDown={onKeyDown}
|
||||
>
|
||||
<div className="dialog">
|
||||
<h3>⚠️ 操作被拒绝</h3>
|
||||
<p className="text-muted" style={{ fontSize: 14, marginBottom: 12, whiteSpace: 'pre-wrap', lineHeight: 1.6 }}>
|
||||
{message}
|
||||
</p>
|
||||
<div className="actions">
|
||||
<button className="btn btn-filled" onClick={onClose}>知道了</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user