2022-02-27 20:07:15 +01:00
|
|
|
import { Redirect, Route, Switch } from "react-router-dom";
|
2022-12-13 23:50:13 +01:00
|
|
|
import { BookmarkContextProvider } from "@/state/bookmark";
|
|
|
|
import { WatchedContextProvider } from "@/state/watched";
|
2023-03-09 18:08:13 +01:00
|
|
|
import { SettingsProvider } from "@/state/settings";
|
2023-01-07 21:36:18 +01:00
|
|
|
|
2022-12-13 23:50:13 +01:00
|
|
|
import { NotFoundPage } from "@/views/notfound/NotFoundView";
|
2023-01-14 01:37:47 +01:00
|
|
|
import { MediaView } from "@/views/media/MediaView";
|
2023-01-07 21:36:18 +01:00
|
|
|
import { SearchView } from "@/views/search/SearchView";
|
2023-01-12 22:04:28 +01:00
|
|
|
import { MWMediaType } from "@/backend/metadata/types";
|
2023-02-18 22:41:50 +01:00
|
|
|
import { V2MigrationView } from "@/views/other/v2Migration";
|
2023-02-22 19:02:23 +01:00
|
|
|
import { DeveloperView } from "@/views/developer/DeveloperView";
|
|
|
|
import { VideoTesterView } from "@/views/developer/VideoTesterView";
|
2023-02-22 20:26:19 +01:00
|
|
|
import { ProviderTesterView } from "@/views/developer/ProviderTesterView";
|
|
|
|
import { EmbedTesterView } from "@/views/developer/EmbedTesterView";
|
2023-03-09 18:08:13 +01:00
|
|
|
import { SettingsView } from "@/views/settings/SettingsView";
|
2023-02-24 21:45:14 +01:00
|
|
|
import { BannerContextProvider } from "@/hooks/useBanner";
|
|
|
|
import { Layout } from "@/setup/Layout";
|
2023-02-24 19:23:00 +01:00
|
|
|
|
2022-05-03 20:58:34 +02:00
|
|
|
function App() {
|
2022-02-06 20:56:48 +01:00
|
|
|
return (
|
2023-03-09 18:08:13 +01:00
|
|
|
<SettingsProvider>
|
|
|
|
<WatchedContextProvider>
|
|
|
|
<BookmarkContextProvider>
|
|
|
|
<BannerContextProvider>
|
|
|
|
<Layout>
|
|
|
|
<Switch>
|
|
|
|
{/* functional routes */}
|
|
|
|
<Route exact path="/v2-migration" component={V2MigrationView} />
|
|
|
|
<Route exact path="/">
|
|
|
|
<Redirect to={`/search/${MWMediaType.MOVIE}`} />
|
|
|
|
</Route>
|
2023-02-22 19:02:23 +01:00
|
|
|
|
2023-03-09 18:08:13 +01:00
|
|
|
{/* 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}
|
|
|
|
/>
|
|
|
|
<Route exact path="/settings" component={SettingsView} />
|
2023-02-22 19:02:23 +01:00
|
|
|
|
2023-03-09 18:08:13 +01:00
|
|
|
{/* 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>
|
|
|
|
</SettingsProvider>
|
2022-02-06 20:56:48 +01:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default App;
|