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:
mgabdev
2020-08-18 12:07:47 -05:00
parent 1c2cb6a63a
commit e5f4e12b7b
37 changed files with 834 additions and 931 deletions

View File

@@ -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)