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
7 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'
|
||
7 years ago
|
import ConfirmTransaction from './confirm-transaction.component'
|
||
6 years ago
|
import { getTotalUnapprovedCount } from '../../selectors/selectors'
|
||
|
import { unconfirmedTransactionsListSelector } from '../../selectors/confirm-transaction'
|
||
7 years ago
|
|
||
7 years ago
|
const mapStateToProps = state => {
|
||
|
const { metamask: { send }, confirmTransaction } = state
|
||
7 years ago
|
|
||
|
return {
|
||
|
totalUnapprovedCount: getTotalUnapprovedCount(state),
|
||
|
send,
|
||
7 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()),
|
||
7 years ago
|
}
|
||
|
}
|
||
|
|
||
|
export default compose(
|
||
|
withRouter,
|
||
7 years ago
|
connect(mapStateToProps, mapDispatchToProps),
|
||
7 years ago
|
)(ConfirmTransaction)
|