2024-02-26 19:17:20 +08:00
|
|
|
import { BrowserRouter, Routes, Route, useLocation } from "react-router-dom";
|
2023-10-19 16:36:46 +08:00
|
|
|
import Editor from "./pages/Editor";
|
|
|
|
import Survey from "./pages/Survey";
|
|
|
|
import BugReport from "./pages/BugReport";
|
2024-01-07 11:10:34 +08:00
|
|
|
import Shortcuts from "./pages/Shortcuts";
|
2023-11-30 15:18:41 +08:00
|
|
|
import Templates from "./pages/Templates";
|
2024-02-26 19:17:20 +08:00
|
|
|
import { useEffect } from "react";
|
|
|
|
import LandingPage from "./pages/LandingPage";
|
|
|
|
|
|
|
|
const Wrapper = ({ children }) => {
|
|
|
|
const location = useLocation();
|
|
|
|
useEffect(() => {
|
|
|
|
window.scroll(0, 0);
|
|
|
|
}, [location.pathname]);
|
|
|
|
return children;
|
|
|
|
};
|
2023-09-19 20:46:33 +08:00
|
|
|
|
|
|
|
function App() {
|
|
|
|
return (
|
2024-02-26 19:17:20 +08:00
|
|
|
<BrowserRouter>
|
|
|
|
<Wrapper>
|
2024-01-07 11:10:34 +08:00
|
|
|
<Routes>
|
2024-02-26 19:17:20 +08:00
|
|
|
<Route path="/" element={<LandingPage />} />
|
2024-01-07 11:10:34 +08:00
|
|
|
<Route path="/editor" element={<Editor />} />
|
|
|
|
<Route path="/survey" element={<Survey />} />
|
|
|
|
<Route path="/shortcuts" element={<Shortcuts />} />
|
|
|
|
<Route path="/bug_report" element={<BugReport />} />
|
|
|
|
<Route path="/templates" element={<Templates />} />
|
|
|
|
</Routes>
|
2024-02-26 19:17:20 +08:00
|
|
|
</Wrapper>
|
|
|
|
</BrowserRouter>
|
2023-09-19 20:46:33 +08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default App;
|