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-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="/">
|
|
|
|
<Redirect to={`/${MWMediaType.MOVIE}`} />
|
|
|
|
</Route>
|
|
|
|
<Route exact path="/media/movie/:media" component={MediaView} />
|
|
|
|
<Route exact path="/media/series/:media" component={MediaView} />
|
|
|
|
<Route exact path="/:type/:query?" component={SearchView} />
|
|
|
|
</Switch>
|
|
|
|
</BookmarkContextProvider>
|
2022-02-18 21:11:23 +01:00
|
|
|
</WatchedContextProvider>
|
2022-02-06 20:56:48 +01:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default App;
|