2018-06-23 08:52:45 +02:00
|
|
|
import { connect } from 'react-redux'
|
|
|
|
import { compose } from 'recompose'
|
|
|
|
import { withRouter } from 'react-router-dom'
|
2018-07-06 20:58:41 +02:00
|
|
|
import {
|
|
|
|
setTransactionToConfirm,
|
|
|
|
clearConfirmTransaction,
|
2019-03-22 00:03:30 +01:00
|
|
|
} from '../../ducks/confirm-transaction/confirm-transaction.duck'
|
2018-09-13 10:47:05 +02:00
|
|
|
import {
|
2018-11-13 17:36:52 +01:00
|
|
|
fetchBasicGasAndTimeEstimates,
|
2019-03-22 00:03:30 +01:00
|
|
|
} from '../../ducks/gas/gas.duck'
|
2018-06-23 08:52:45 +02:00
|
|
|
import ConfirmTransaction from './confirm-transaction.component'
|
2019-03-22 00:03:30 +01:00
|
|
|
import { getTotalUnapprovedCount } from '../../selectors/selectors'
|
|
|
|
import { unconfirmedTransactionsListSelector } from '../../selectors/confirm-transaction'
|
2018-06-23 08:52:45 +02:00
|
|
|
|
2018-06-25 21:06:57 +02:00
|
|
|
const mapStateToProps = state => {
|
|
|
|
const { metamask: { send }, confirmTransaction } = state
|
2018-06-23 08:52:45 +02:00
|
|
|
|
|
|
|
return {
|
|
|
|
totalUnapprovedCount: getTotalUnapprovedCount(state),
|
|
|
|
send,
|
2018-06-25 21:06:57 +02:00
|
|
|
confirmTransaction,
|
|
|
|
unconfirmedTransactions: unconfirmedTransactionsListSelector(state),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const mapDispatchToProps = dispatch => {
|
|
|
|
return {
|
|
|
|
setTransactionToConfirm: transactionId => dispatch(setTransactionToConfirm(transactionId)),
|
2018-07-06 20:58:41 +02:00
|
|
|
clearConfirmTransaction: () => dispatch(clearConfirmTransaction()),
|
2018-11-13 17:36:52 +01:00
|
|
|
fetchBasicGasAndTimeEstimates: () => dispatch(fetchBasicGasAndTimeEstimates()),
|
2018-06-23 08:52:45 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default compose(
|
|
|
|
withRouter,
|
2018-06-25 21:06:57 +02:00
|
|
|
connect(mapStateToProps, mapDispatchToProps),
|
2018-06-23 08:52:45 +02:00
|
|
|
)(ConfirmTransaction)
|