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.
38 lines
1.2 KiB
38 lines
1.2 KiB
6 years ago
|
import { connect } from 'react-redux'
|
||
|
import { compose } from 'recompose'
|
||
|
import { withRouter } from 'react-router-dom'
|
||
6 years ago
|
import {
|
||
|
setTransactionToConfirm,
|
||
|
clearConfirmTransaction,
|
||
6 years ago
|
} from '../../ducks/confirm-transaction/confirm-transaction.duck'
|
||
6 years ago
|
import {
|
||
6 years ago
|
fetchBasicGasAndTimeEstimates,
|
||
6 years ago
|
} from '../../ducks/gas/gas.duck'
|
||
6 years ago
|
import ConfirmTransaction from './confirm-transaction.component'
|
||
6 years ago
|
import { getTotalUnapprovedCount } from '../../selectors/selectors'
|
||
|
import { unconfirmedTransactionsListSelector } from '../../selectors/confirm-transaction'
|
||
6 years ago
|
|
||
6 years ago
|
const mapStateToProps = state => {
|
||
|
const { metamask: { send }, confirmTransaction } = state
|
||
6 years ago
|
|
||
|
return {
|
||
|
totalUnapprovedCount: getTotalUnapprovedCount(state),
|
||
|
send,
|
||
6 years ago
|
confirmTransaction,
|
||
|
unconfirmedTransactions: unconfirmedTransactionsListSelector(state),
|
||
|
}
|
||
|
}
|
||
|
|
||
|
const mapDispatchToProps = dispatch => {
|
||
|
return {
|
||
|
setTransactionToConfirm: transactionId => dispatch(setTransactionToConfirm(transactionId)),
|
||
6 years ago
|
clearConfirmTransaction: () => dispatch(clearConfirmTransaction()),
|
||
6 years ago
|
fetchBasicGasAndTimeEstimates: () => dispatch(fetchBasicGasAndTimeEstimates()),
|
||
6 years ago
|
}
|
||
|
}
|
||
|
|
||
|
export default compose(
|
||
|
withRouter,
|
||
6 years ago
|
connect(mapStateToProps, mapDispatchToProps),
|
||
6 years ago
|
)(ConfirmTransaction)
|