50034331bc
1、统一消息系统:将 background、content 和 popup 的通信方式从原生的 chrome.runtime 迁移至 @webext-core/messaging,修复了消息回调返回 undefined 的问题。 2、优化组件结构:将通用组件从 entrypoints/popup/components 迁移至根目录 components,并使用 MUI 重构了 Navbar。 3、同步更新:调整了录制工具 (useRecorder) 和各页面组件(RecordeReplayPage, TestPage等),以适配新的消息协议和组件路径。
35 lines
1.0 KiB
TypeScript
35 lines
1.0 KiB
TypeScript
// App.js
|
|
import { HashRouter as Router, Routes, Route } from 'react-router-dom';
|
|
import TimestampPage from './pages/TimestampPage';
|
|
import RecordeReplayPage from './pages/RecordeReplayPage';
|
|
import TestPage from './pages/TestPage';
|
|
import Navbar from '../../components/Navbar';
|
|
import RoutePersistence from '../../components/RoutePersistence';
|
|
import './App.css';
|
|
|
|
// 路由配置数据
|
|
const navItems = [
|
|
{ path: '/test', label: '测试页面', element: <TestPage /> },
|
|
{ path: '/', label: '时间戳', element: <TimestampPage /> },
|
|
{ path: '/recorde-replay', label: '录制与回放', element: <RecordeReplayPage /> },
|
|
];
|
|
|
|
function App() {
|
|
return (
|
|
<Router future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
|
<RoutePersistence />
|
|
<div className="app">
|
|
<Navbar items={navItems} />
|
|
|
|
<Routes>
|
|
{navItems.map((item) => (
|
|
<Route key={item.path} path={item.path} element={item.element} />
|
|
))}
|
|
</Routes>
|
|
</div>
|
|
</Router>
|
|
);
|
|
}
|
|
|
|
export default App;
|