mirror of
https://github.com/movie-web/movie-web.git
synced 2024-11-15 10:25:07 +01:00
24aeb68f55
Co-authored-by: Jip Frijlink <JipFr@users.noreply.github.com>
62 lines
2.2 KiB
TypeScript
62 lines
2.2 KiB
TypeScript
import { Redirect, Route, Switch } from "react-router-dom";
|
|
import { BookmarkContextProvider } from "@/state/bookmark";
|
|
import { WatchedContextProvider } from "@/state/watched";
|
|
|
|
import { NotFoundPage } from "@/views/notfound/NotFoundView";
|
|
import { MediaView } from "@/views/media/MediaView";
|
|
import { SearchView } from "@/views/search/SearchView";
|
|
import { MWMediaType } from "@/backend/metadata/types";
|
|
import { V2MigrationView } from "@/views/other/v2Migration";
|
|
import { DeveloperView } from "@/views/developer/DeveloperView";
|
|
import { VideoTesterView } from "@/views/developer/VideoTesterView";
|
|
import { ProviderTesterView } from "@/views/developer/ProviderTesterView";
|
|
import { EmbedTesterView } from "@/views/developer/EmbedTesterView";
|
|
import { BannerContextProvider } from "@/hooks/useBanner";
|
|
import { Layout } from "@/setup/Layout";
|
|
|
|
function App() {
|
|
return (
|
|
<WatchedContextProvider>
|
|
<BookmarkContextProvider>
|
|
<BannerContextProvider>
|
|
<Layout>
|
|
<Switch>
|
|
{/* functional routes */}
|
|
<Route exact path="/v2-migration" component={V2MigrationView} />
|
|
<Route exact path="/">
|
|
<Redirect to={`/search/${MWMediaType.MOVIE}`} />
|
|
</Route>
|
|
|
|
{/* pages */}
|
|
<Route exact path="/media/:media" component={MediaView} />
|
|
<Route
|
|
exact
|
|
path="/media/:media/:season/:episode"
|
|
component={MediaView}
|
|
/>
|
|
<Route
|
|
exact
|
|
path="/search/:type/:query?"
|
|
component={SearchView}
|
|
/>
|
|
|
|
{/* other */}
|
|
<Route exact path="/dev" component={DeveloperView} />
|
|
<Route exact path="/dev/video" component={VideoTesterView} />
|
|
<Route
|
|
exact
|
|
path="/dev/providers"
|
|
component={ProviderTesterView}
|
|
/>
|
|
<Route exact path="/dev/embeds" component={EmbedTesterView} />
|
|
<Route path="*" component={NotFoundPage} />
|
|
</Switch>
|
|
</Layout>
|
|
</BannerContextProvider>
|
|
</BookmarkContextProvider>
|
|
</WatchedContextProvider>
|
|
);
|
|
}
|
|
|
|
export default App;
|