FitTrackee/fittrackee_client/src/components/User/Logout.jsx

41 lines
899 B
React
Raw Normal View History

import React from 'react'
import { connect } from 'react-redux'
import { Link } from 'react-router-dom'
2018-04-29 17:18:16 +02:00
import { logout } from '../../actions/user'
class Logout extends React.Component {
componentDidMount() {
this.props.UserLogout()
}
render() {
return (
2018-06-07 22:44:52 +02:00
<div className="container dashboard">
<div className="row">
<div className="col-2" />
<div className="card col-8">
<div className="card-body">
<div className="text-center">
You are now logged out.
Click <Link to="/login">here</Link> to log back in.
</div>
</div>
</div>
<div className="col-2" />
</div>
</div>
)
}
}
export default connect(
state => ({
user: state.user,
}),
dispatch => ({
UserLogout: () => {
dispatch(logout())
}
})
)(Logout)