36 lines
2.1 KiB
React
36 lines
2.1 KiB
React
// Author: fruit.com.cn
|
|
import { lazy } from 'react';
|
|
import { Route, Routes } from 'react-router-dom';
|
|
import { AppShell } from '../layouts/AppShell';
|
|
|
|
const HomePage = lazy(() => import('../features/home/HomePage').then((module) => ({ default: module.HomePage })));
|
|
const ShortsFeedPage = lazy(() => import('../features/shorts/ShortsFeedPage').then((module) => ({ default: module.ShortsFeedPage })));
|
|
const WatchPage = lazy(() => import('../features/watch/WatchPage').then((module) => ({ default: module.WatchPage })));
|
|
const SearchPage = lazy(() => import('../features/search/SearchPage').then((module) => ({ default: module.SearchPage })));
|
|
const HistoryPage = lazy(() => import('../features/history/HistoryPage').then((module) => ({ default: module.HistoryPage })));
|
|
const ListingPage = lazy(() => import('../features/listing/ListingPage').then((module) => ({ default: module.ListingPage })));
|
|
const AboutPage = lazy(() => import('../features/about/AboutPage').then((module) => ({ default: module.AboutPage })));
|
|
const ContactPage = lazy(() => import('../features/about/ContactPage').then((module) => ({ default: module.ContactPage })));
|
|
const LegalPage = lazy(() => import('../features/legal/LegalPage').then((module) => ({ default: module.LegalPage })));
|
|
|
|
export function AppRouter() {
|
|
return (
|
|
<Routes>
|
|
<Route element={<AppShell />}>
|
|
<Route path="/" element={<HomePage />} />
|
|
<Route path="/shorts" element={<ShortsFeedPage />} />
|
|
<Route path="/subscriptions" element={<ListingPage type="subscriptions" />} />
|
|
<Route path="/library" element={<ListingPage type="library" />} />
|
|
<Route path="/history" element={<HistoryPage />} />
|
|
<Route path="/about" element={<AboutPage />} />
|
|
<Route path="/contact" element={<ContactPage />} />
|
|
<Route path="/privacy" element={<LegalPage type="privacy" />} />
|
|
<Route path="/privacy-policy" element={<LegalPage type="privacy" />} />
|
|
<Route path="/terms" element={<LegalPage type="terms" />} />
|
|
<Route path="/search" element={<SearchPage />} />
|
|
<Route path="/watch/:id" element={<WatchPage />} />
|
|
</Route>
|
|
</Routes>
|
|
);
|
|
}
|