forked from manikandanraji/youtubeclone-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRouter.js
54 lines (49 loc) · 1.64 KB
/
Router.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import React from "react";
import {
BrowserRouter as Router,
Route,
Redirect,
Switch,
} from "react-router-dom";
// components
import ScrollToTop from "./components/ScrollToTop";
import Navbar from "./components/Navbar";
import BottomBar from "./components/BottomBar";
import Sidebar from "./components/Sidebar";
// styles
import Container from "./styles/Container";
// pages
import Home from "./pages/Home";
import Trending from "./pages/Trending";
import Subscriptions from "./pages/Subscriptions";
import Channel from "./pages/Channel";
import WatchVideo from "./pages/WatchVideo";
import SearchResults from "./pages/SearchResults";
import Library from "./pages/Library";
import History from "./pages/History";
import YourVideos from "./pages/YourVideos";
import LikedVideos from "./pages/LikedVideos";
const AppRouter = () => (
<Router>
<ScrollToTop />
<Navbar />
<Sidebar />
<BottomBar />
<Container>
<Switch>
<Route path="/watch/:videoId" component={WatchVideo} />
<Route path="/channel/:userId" component={Channel} />
<Route path="/results/:searchterm" component={SearchResults} />
<Route path="/feed/trending" component={Trending} />
<Route path="/feed/subscriptions" component={Subscriptions} />
<Route path="/feed/library" component={Library} />
<Route path="/feed/history" component={History} />
<Route path="/feed/my_videos" component={YourVideos} />
<Route path="/feed/liked_videos" component={LikedVideos} />
<Route path="/" component={Home} />
<Redirect to="/" />
</Switch>
</Container>
</Router>
);
export default AppRouter;