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 { MWMediaType } from "@/providers";
|
|
|
|
import { BookmarkContextProvider } from "@/state/bookmark";
|
|
|
|
import { WatchedContextProvider } from "@/state/watched";
|
2023-01-07 21:36:18 +01:00
|
|
|
|
2022-12-13 23:50:13 +01:00
|
|
|
import { NotFoundPage } from "@/views/notfound/NotFoundView";
|
2023-01-07 21:36:18 +01:00
|
|
|
import { MediaView } from "@/views/MediaView";
|
|
|
|
import { SearchView } from "@/views/search/SearchView";
|
2023-01-08 13:15:32 +01:00
|
|
|
import { TestView } from "@/views/TestView";
|
2022-02-06 20:56:48 +01:00
|
|
|
|
2022-05-03 20:58:34 +02:00
|
|
|
function App() {
|
2022-02-06 20:56:48 +01:00
|
|
|
return (
|
2022-02-18 21:11:23 +01:00
|
|
|
<WatchedContextProvider>
|
2022-02-28 00:08:20 +01:00
|
|
|
<BookmarkContextProvider>
|
|
|
|
<Switch>
|
2022-12-27 15:12:27 +01:00
|
|
|
<Route exact path="/">
|
2022-02-28 00:28:57 +01:00
|
|
|
<Redirect to={`/search/${MWMediaType.MOVIE}`} />
|
2022-02-28 00:08:20 +01:00
|
|
|
</Route>
|
|
|
|
<Route exact path="/media/movie/:media" component={MediaView} />
|
|
|
|
<Route exact path="/media/series/:media" component={MediaView} />
|
2022-02-28 00:28:57 +01:00
|
|
|
<Route exact path="/search/:type/:query?" component={SearchView} />
|
2023-01-08 13:15:32 +01:00
|
|
|
<Route exact path="/test" component={TestView} />
|
2022-02-28 00:28:57 +01:00
|
|
|
<Route path="*" component={NotFoundPage} />
|
2022-02-28 00:08:20 +01:00
|
|
|
</Switch>
|
|
|
|
</BookmarkContextProvider>
|
2022-02-18 21:11:23 +01:00
|
|
|
</WatchedContextProvider>
|
2022-02-06 20:56:48 +01:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default App;
|