GoScrobble/web/src/App.js

45 lines
1.2 KiB
JavaScript
Raw Normal View History

2021-03-24 03:29:35 +00:00
import './App.css';
2021-03-25 08:13:28 +00:00
import Home from './Components/Pages/Home';
import About from './Components/Pages/About';
2021-03-28 08:52:34 +00:00
import Help from './Components/Pages/Help';
2021-03-26 08:06:28 +00:00
import Login from './Components/Pages/Login';
import Settings from './Components/Pages/Settings';
2021-03-26 22:51:03 +00:00
import Register from './Components/Pages/Register';
import Navigation from './Components/Navigation';
2021-03-26 08:06:28 +00:00
2021-03-28 08:52:34 +00:00
import { Route, Switch, withRouter } from 'react-router-dom';
2021-03-26 02:31:00 +00:00
import { connect } from "react-redux";
2021-03-25 08:13:28 +00:00
import '../node_modules/bootstrap/dist/css/bootstrap.min.css';
2021-03-24 03:29:35 +00:00
2021-03-26 02:31:00 +00:00
function mapStateToProps(state) {
return {
isLoggedIn: state
};
}
function mapDispatchToProps(dispatch) {
return {
logIn: () => dispatch({type: true}),
logOut: () => dispatch({type: false})
};
}
2021-03-25 08:13:28 +00:00
2021-03-26 08:06:28 +00:00
const App = () => {
let exact = true
2021-03-24 03:29:35 +00:00
return (
<div>
<Navigation />
<Switch>
<Route exact={exact} path="/" component={Home} />
<Route path="/about" component={About} />
<Route path="/settings" component={Settings} />
2021-03-28 08:52:34 +00:00
<Route path="/help" component={Help} />
<Route path="/login" component={Login} />
<Route path="/register" component={Register} />
</Switch>
</div>
2021-03-24 03:29:35 +00:00
);
}
2021-03-28 08:52:34 +00:00
export default withRouter(connect(mapStateToProps, mapDispatchToProps)(App));