You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.2 KiB
37 lines
1.2 KiB
import { connect } from 'react-redux'
|
|
import { compose } from 'recompose'
|
|
import { withRouter } from 'react-router-dom'
|
|
import {
|
|
setTransactionToConfirm,
|
|
clearConfirmTransaction,
|
|
} from '../../../ducks/confirm-transaction.duck'
|
|
import {
|
|
fetchBasicGasEstimates,
|
|
} from '../../../ducks/gas.duck'
|
|
import ConfirmTransaction from './confirm-transaction.component'
|
|
import { getTotalUnapprovedCount } from '../../../selectors'
|
|
import { unconfirmedTransactionsListSelector } from '../../../selectors/confirm-transaction'
|
|
|
|
const mapStateToProps = state => {
|
|
const { metamask: { send }, confirmTransaction } = state
|
|
|
|
return {
|
|
totalUnapprovedCount: getTotalUnapprovedCount(state),
|
|
send,
|
|
confirmTransaction,
|
|
unconfirmedTransactions: unconfirmedTransactionsListSelector(state),
|
|
}
|
|
}
|
|
|
|
const mapDispatchToProps = dispatch => {
|
|
return {
|
|
setTransactionToConfirm: transactionId => dispatch(setTransactionToConfirm(transactionId)),
|
|
clearConfirmTransaction: () => dispatch(clearConfirmTransaction()),
|
|
fetchBasicGasEstimates: () => dispatch(fetchBasicGasEstimates()),
|
|
}
|
|
}
|
|
|
|
export default compose(
|
|
withRouter,
|
|
connect(mapStateToProps, mapDispatchToProps),
|
|
)(ConfirmTransaction)
|
|
|