Skip to content

Commit

Permalink
code format prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
manikandanraji committed Jul 9, 2020
1 parent f83f9cc commit 56c33e6
Show file tree
Hide file tree
Showing 68 changed files with 3,450 additions and 3,452 deletions.
22 changes: 13 additions & 9 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,21 @@ import Auth from "./components/Auth";
import "react-toastify/dist/ReactToastify.css";

const App = ({ user }) => {
const loggedIn = user.token;
const loggedIn = user.token;

return (
<ThemeProvider theme={darkTheme}>
<GlobalStyle />
<ToastContainer autoClose={2500} position="top-right" closeButton={false}/>
{loggedIn ? <Router /> : <Auth />}
</ThemeProvider>
);
return (
<ThemeProvider theme={darkTheme}>
<GlobalStyle />
<ToastContainer
autoClose={2500}
position="top-right"
closeButton={false}
/>
{loggedIn ? <Router /> : <Auth />}
</ThemeProvider>
);
};

const mapStateToProps = state => ({ user: state.user });
const mapStateToProps = (state) => ({ user: state.user });

export default connect(mapStateToProps)(App);
48 changes: 24 additions & 24 deletions src/Router.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from "react";
import {
BrowserRouter as Router,
Route,
Redirect,
Switch
BrowserRouter as Router,
Route,
Redirect,
Switch,
} from "react-router-dom";

// components
Expand All @@ -27,26 +27,26 @@ import YourVideos from "./pages/YourVideos";
import LikedVideos from "./pages/LikedVideos";

const AppRouter = () => (
<Router>
<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>
<Router>
<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;
Loading

0 comments on commit 56c33e6

Please sign in to comment.