3b13ee67c0
Client: login/register Client: login/register Client: login/register Client: login/register Client: login/register Client: login/register Client: login/register Client: login/register
32 lines
566 B
JavaScript
32 lines
566 B
JavaScript
import React from 'react'
|
|
import { connect } from 'react-redux'
|
|
import { Link } from 'react-router-dom'
|
|
|
|
import { logout } from '../actions'
|
|
|
|
class Logout extends React.Component {
|
|
componentDidMount() {
|
|
this.props.UserLogout()
|
|
}
|
|
render() {
|
|
return (
|
|
<div>
|
|
<p>
|
|
You are now logged out.
|
|
Click <Link to="/login">here</Link> to log back in.</p>
|
|
</div>
|
|
)
|
|
}
|
|
}
|
|
|
|
export default connect(
|
|
state => ({
|
|
user: state.user,
|
|
}),
|
|
dispatch => ({
|
|
UserLogout: () => {
|
|
dispatch(logout())
|
|
}
|
|
})
|
|
)(Logout)
|