mirror of
https://github.com/LHY0125/PathEditor.git
synced 2026-06-29 18:15:55 +08:00
refactor: 抽取 Modal 组件、支持 JSON/CSV 导出、清理冗余代码
- 新增 Modal 组件,消除 3 个 Dialog 中重复的遮罩层/Escape/stopPropagation 代码 - PathEditDialog/HelpDialog/ImportDialog 改用 Modal 包裹 - handleExport 支持 JSON/CSV 两种格式(CSV 导出代码之前存在但从未接线) - App.tsx 移除冗余的 initDarkMode 后重复设 store 的逻辑 - ErrorBoundary 添加 componentDidCatch 日志和 console.error Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
+1
-5
@@ -1,6 +1,6 @@
|
||||
import { useEffect } from 'react';
|
||||
import { useAppStore } from '@/store/app-store';
|
||||
import { initDarkMode, useThemeStore } from '@/store/theme-store';
|
||||
import { initDarkMode } from '@/store/theme-store';
|
||||
import { AppShell } from '@/components/layout/AppShell';
|
||||
import { ErrorBoundary } from '@/components/layout/ErrorBoundary';
|
||||
|
||||
@@ -9,10 +9,6 @@ export default function App() {
|
||||
|
||||
useEffect(() => {
|
||||
initDarkMode();
|
||||
const saved = localStorage.getItem('darkMode');
|
||||
if (saved === '1') {
|
||||
useThemeStore.setState({ isDark: true });
|
||||
}
|
||||
initialize();
|
||||
}, [initialize]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user