ionian/packages/client/src/App.tsx
monoid 88c7a8bc53 [BREAKING!]: 서버 재작업 (#16)
서버 실행 바꾸고 여기 저기 path 바꿈.

Reviewed-on: #16
2024-10-09 00:18:56 +09:00

54 lines
1.7 KiB
TypeScript

import { Route, Switch, Redirect } from "wouter";
import { useTernaryDarkMode } from "usehooks-ts";
import { useEffect } from "react";
import './App.css'
import { TooltipProvider } from "./components/ui/tooltip.tsx";
import Layout from "./components/layout/layout.tsx";
import Gallery from "@/page/galleryPage.tsx";
import NotFoundPage from "@/page/404.tsx";
import LoginPage from "@/page/loginPage.tsx";
import ProfilePage from "@/page/profilesPage.tsx";
import ContentInfoPage from "@/page/contentInfoPage.tsx";
import SettingPage from "@/page/settingPage.tsx";
import ComicPage from "@/page/reader/comicPage.tsx";
import DifferencePage from "./page/differencePage.tsx";
import TagsPage from "./page/tagsPage.tsx";
import TaskQueuePage from "./page/taskQueuePage.tsx";
const App = () => {
const { isDarkMode } = useTernaryDarkMode();
useEffect(() => {
if (isDarkMode) {
document.body.classList.add("dark");
}
else {
document.body.classList.remove("dark");
}
}, [isDarkMode]);
return (
<TooltipProvider>
<Layout>
<Switch>
<Route path="/" component={() => <Redirect replace to="/search?" />} />
<Route path="/search" component={Gallery} />
<Route path="/login" component={LoginPage} />
<Route path="/profile" component={ProfilePage}/>
<Route path="/doc/:id" component={ContentInfoPage}/>
<Route path="/setting" component={SettingPage} />
<Route path="/doc/:id/reader" component={ComicPage}/>
<Route path="/difference" component={DifferencePage}/>
<Route path="/tags" component={TagsPage}/>
<Route path="/queue" component={TaskQueuePage} />
<Route component={NotFoundPage} />
</Switch>
</Layout>
</TooltipProvider>);
};
export default App