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';
|
2021-03-27 21:39:08 +00:00
|
|
|
import Settings from './Components/Pages/Settings';
|
2021-03-26 22:51:03 +00:00
|
|
|
import Register from './Components/Pages/Register';
|
2021-03-27 04:05:05 +00:00
|
|
|
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 (
|
2021-03-27 21:39:08 +00:00
|
|
|
<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} />
|
2021-03-27 21:39:08 +00:00
|
|
|
<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));
|