perf: 性能优化与代码质量改进
- 添加4个数据库索引提升查询性能 - 启用ESLint并配置React支持 - 修复ESLint错误(未使用的导入和状态) - 简化Toast组件UI样式 - 移除重复文件(server.js.backup) - 清理.gitignore中的.next目录 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
1e478c2eaa
commit
3975bbed73
@@ -1,5 +1,4 @@
|
||||
import { createContext, useCallback, useContext, useMemo, useRef, useState } from 'react';
|
||||
import { Icon } from './icons';
|
||||
|
||||
const ToastContext = createContext(null);
|
||||
|
||||
@@ -39,13 +38,7 @@ export function ToastProvider({ children }) {
|
||||
<div className="toast-stack" aria-live="polite" aria-atomic="true">
|
||||
{toasts.map((toast) => (
|
||||
<div key={toast.id} className={`toast toast--${toast.tone}`}>
|
||||
<span className="toast__icon">
|
||||
<Icon name={toast.tone === 'success' ? 'check' : toast.tone === 'error' ? 'close' : 'info'} size={16} />
|
||||
</span>
|
||||
<span className="toast__message">{toast.message}</span>
|
||||
<button type="button" className="icon-button icon-button--ghost toast__close" aria-label="关闭提示" onClick={() => removeToast(toast.id)}>
|
||||
<Icon name="close" size={16} />
|
||||
</button>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user