21 lines
555 B
JavaScript
21 lines
555 B
JavaScript
import { connect } from 'react-redux';
|
|
import { push } from 'connected-react-router';
|
|
import { bindActionCreators } from 'redux';
|
|
import LoggedIn from '../components/LoggedIn';
|
|
import userActions from '../actions/user';
|
|
|
|
const mapStateToProps = (state) => {
|
|
return state;
|
|
};
|
|
|
|
const mapDispatchToProps = (dispatch) => {
|
|
const user = bindActionCreators(userActions, dispatch);
|
|
return {
|
|
onLogout: (data) => {
|
|
user.logout(data);
|
|
dispatch(push('/'));
|
|
},
|
|
};
|
|
};
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(LoggedIn);
|