movie-web/src/App.tsx

27 lines
877 B
TypeScript
Raw Normal View History

import { MWMediaType } from "providers";
import { Redirect, Route, Switch } from "react-router-dom";
import { BookmarkContextProvider } from "state/bookmark";
import { WatchedContextProvider } from "state/watched";
import "./index.css";
import { MediaView } from "./views/MediaView";
import { SearchView } from "./views/SearchView";
2022-02-06 20:56:48 +01:00
function App() {
return (
<WatchedContextProvider>
<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>
</WatchedContextProvider>
2022-02-06 20:56:48 +01:00
);
}
export default App;