GoScrobble/web/src/App.js

39 lines
904 B
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';
import Navigation from './Components/Pages/Navigation';
import { Route, Switch, HashRouter } 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 02:31:00 +00:00
}
2021-03-25 08:13:28 +00:00
2021-03-26 02:31:00 +00:00
const App = (props) => {
2021-03-24 03:29:35 +00:00
return (
2021-03-25 08:13:28 +00:00
<HashRouter>
<div className="wrapper">
<Navigation />
<Switch>
<Route exact path="/" component={Home} />
<Route path="/about" component={About} />
</Switch>
</div>
</HashRouter>
2021-03-24 03:29:35 +00:00
);
}
2021-03-26 02:31:00 +00:00
export default connect(mapStateToProps, mapDispatchToProps)(App);