mirror of
https://github.com/movie-web/movie-web.git
synced 2024-11-15 11:35:07 +01:00
29 lines
1005 B
TypeScript
29 lines
1005 B
TypeScript
import { MWMediaType } from "providers";
|
|
import { Redirect, Route, Switch } from "react-router-dom";
|
|
import { BookmarkContextProvider } from "state/bookmark";
|
|
import { WatchedContextProvider } from "state/watched";
|
|
import { NotFoundPage } from "views/notfound/NotFoundView";
|
|
import "./index.css";
|
|
import { MediaView } from "./views/MediaView";
|
|
import { SearchView } from "./views/SearchView";
|
|
|
|
function App() {
|
|
return (
|
|
<WatchedContextProvider>
|
|
<BookmarkContextProvider>
|
|
<Switch>
|
|
<Route exact path="/">
|
|
<Redirect to={`/search/${MWMediaType.MOVIE}`} />
|
|
</Route>
|
|
<Route exact path="/media/movie/:media" component={MediaView} />
|
|
<Route exact path="/media/series/:media" component={MediaView} />
|
|
<Route exact path="/search/:type/:query?" component={SearchView} />
|
|
<Route path="*" component={NotFoundPage} />
|
|
</Switch>
|
|
</BookmarkContextProvider>
|
|
</WatchedContextProvider>
|
|
);
|
|
}
|
|
|
|
export default App;
|