Continuing updating the reformatting of propTypes and set redux, intl functions to end of component
Continuing updating the reformatting of propTypes and set redux, intl functions to end of component
This commit is contained in:
@@ -7,23 +7,8 @@ import ImmutablePropTypes from 'react-immutable-proptypes'
|
||||
import { unfollowAccount } from '../../actions/accounts'
|
||||
import ConfirmationModal from './confirmation_modal'
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
onConfirm(accountId) {
|
||||
dispatch(unfollowAccount(accountId))
|
||||
},
|
||||
})
|
||||
|
||||
export default
|
||||
@connect(null, mapDispatchToProps)
|
||||
class UnfollowModal extends ImmutablePureComponent {
|
||||
|
||||
static propTypes = {
|
||||
isSubmitting: PropTypes.bool.isRequired,
|
||||
account: ImmutablePropTypes.map.isRequired,
|
||||
onConfirm: PropTypes.func.isRequired,
|
||||
onClose: PropTypes.func.isRequired,
|
||||
}
|
||||
|
||||
handleClick = () => {
|
||||
this.props.onClose()
|
||||
this.props.onConfirm(this.props.account.get('id'))
|
||||
@@ -48,3 +33,18 @@ class UnfollowModal extends ImmutablePureComponent {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
onConfirm(accountId) {
|
||||
dispatch(unfollowAccount(accountId))
|
||||
},
|
||||
})
|
||||
|
||||
UnfollowModal.propTypes = {
|
||||
isSubmitting: PropTypes.bool.isRequired,
|
||||
account: ImmutablePropTypes.map.isRequired,
|
||||
onConfirm: PropTypes.func.isRequired,
|
||||
onClose: PropTypes.func.isRequired,
|
||||
}
|
||||
|
||||
export default connect(null, mapDispatchToProps)(UnfollowModal)
|
||||
Reference in New Issue
Block a user