2022-02-27 20:07:15 +01:00
|
|
|
import { MWMediaType } from "providers";
|
|
|
|
import { Redirect, Route, Switch } from "react-router-dom";
|
2022-02-28 00:08:20 +01:00
|
|
|
import { BookmarkContextProvider } from "state/bookmark";
|
|
|
|
import { WatchedContextProvider } from "state/watched";
|
2022-03-06 12:56:22 +01:00
|
|
|
import { NotFoundPage } from "views/notfound/NotFoundView";
|
2022-02-18 21:11:23 +01:00
|
|
|
import "./index.css";
|
2022-02-28 00:08:20 +01:00
|
|
|
import { MediaView } from "./views/MediaView";
|
2022-02-18 21:11:23 +01:00
|
|
|
import { SearchView } from "./views/SearchView";
|
2022-02-06 20:56:48 +01:00
|
|
|
|
|
|
|
function App() {
|
|
|
|
return (
|
2022-02-18 21:11:23 +01:00
|
|
|
<WatchedContextProvider>
|
2022-02-28 00:08:20 +01:00
|
|
|
<BookmarkContextProvider>
|
|
|
|
<Switch>
|
|
|
|
<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} />
|
|
|
|
<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;
|