feat: 版主子管理页(帖子管理/公告/禁言)+ 版块级禁言(migrations v5)

This commit is contained in:
2026-08-12 18:44:47 +08:00
parent a9726df1ee
commit b301a44caf
12 changed files with 1025 additions and 20 deletions
+34
View File
@@ -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>
);
}