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

@@ -6,30 +6,8 @@ import { makeGetAccount } from '../../selectors'
import { blockAccount } from '../../actions/accounts'
import ConfirmationModal from './confirmation_modal'
const messages = defineMessages({
title: { id: 'group_delete_title', defaultMessage: 'Delete "{group}"' },
groupMessage: { id: 'confirmations.group_delete.message', defaultMessage: 'Are you sure you want to delete "{group}"?' },
delete: { id: 'delete', defaultMessage: 'Delete' },
})
const mapDispatchToProps = (dispatch) => ({
onConfirm(account) {
// dispatch(blockAccount(account.get('id')))
},
})
export default
@connect(null, mapDispatchToProps)
@injectIntl
class GroupDeleteModal extends React.PureComponent {
static propTypes = {
group: PropTypes.object.isRequired,
onConfirm: PropTypes.func.isRequired,
onClose: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired,
}
handleClick = () => {
this.props.onConfirm(this.props.account)
}
@@ -56,3 +34,24 @@ class GroupDeleteModal extends React.PureComponent {
}
}
const messages = defineMessages({
title: { id: 'group_delete_title', defaultMessage: 'Delete "{group}"' },
groupMessage: { id: 'confirmations.group_delete.message', defaultMessage: 'Are you sure you want to delete "{group}"?' },
delete: { id: 'delete', defaultMessage: 'Delete' },
})
const mapDispatchToProps = (dispatch) => ({
onConfirm(account) {
// dispatch(blockAccount(account.get('id')))
},
})
GroupDeleteModal.propTypes = {
group: PropTypes.object.isRequired,
onConfirm: PropTypes.func.isRequired,
onClose: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired,
}
export default injectIntl(connect(null, mapDispatchToProps)(GroupDeleteModal))