parent
7610248f8c
commit
2e35c05f14
@ -0,0 +1 @@ |
||||
export { default } from './reject-transactions.container' |
@ -0,0 +1,6 @@ |
||||
.reject-transactions { |
||||
&__description { |
||||
text-align: center; |
||||
font-size: .875rem; |
||||
} |
||||
} |
@ -0,0 +1,45 @@ |
||||
import PropTypes from 'prop-types' |
||||
import React, { PureComponent } from 'react' |
||||
import Modal from '../../modal' |
||||
|
||||
export default class RejectTransactionsModal extends PureComponent { |
||||
static contextTypes = { |
||||
t: PropTypes.func.isRequired, |
||||
} |
||||
|
||||
static propTypes = { |
||||
onSubmit: PropTypes.func.isRequired, |
||||
hideModal: PropTypes.func.isRequired, |
||||
unapprovedTxCount: PropTypes.number.isRequired, |
||||
} |
||||
|
||||
onSubmit = async () => { |
||||
const { onSubmit, hideModal } = this.props |
||||
|
||||
await onSubmit() |
||||
hideModal() |
||||
} |
||||
|
||||
render () { |
||||
const { t } = this.context |
||||
const { hideModal, unapprovedTxCount } = this.props |
||||
|
||||
return ( |
||||
<Modal |
||||
headerText={t('rejectTxsN', [unapprovedTxCount])} |
||||
onClose={hideModal} |
||||
onSubmit={this.onSubmit} |
||||
onCancel={hideModal} |
||||
submitText={t('reject')} |
||||
cancelText={t('cancel')} |
||||
submitType="secondary" |
||||
> |
||||
<div> |
||||
<div className="reject-transactions__description"> |
||||
{ t('rejectTxsDescription', [unapprovedTxCount]) } |
||||
</div> |
||||
</div> |
||||
</Modal> |
||||
) |
||||
} |
||||
} |
@ -0,0 +1,17 @@ |
||||
import { connect } from 'react-redux' |
||||
import { compose } from 'recompose' |
||||
import RejectTransactionsModal from './reject-transactions.component' |
||||
import withModalProps from '../../../higher-order-components/with-modal-props' |
||||
|
||||
const mapStateToProps = (state, ownProps) => { |
||||
const { unapprovedTxCount } = ownProps |
||||
|
||||
return { |
||||
unapprovedTxCount, |
||||
} |
||||
} |
||||
|
||||
export default compose( |
||||
withModalProps, |
||||
connect(mapStateToProps), |
||||
)(RejectTransactionsModal) |
Loading…
Reference in new issue