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.
28 lines
648 B
28 lines
648 B
import { connect } from 'react-redux'
|
|
import ConfirmApprove from './confirm-approve.component'
|
|
|
|
const mapStateToProps = state => {
|
|
const { confirmTransaction } = state
|
|
const {
|
|
tokenData = {},
|
|
txData: { txParams: { to: tokenAddress } = {} } = {},
|
|
tokenProps: { tokenSymbol } = {},
|
|
} = confirmTransaction
|
|
const { params = [] } = tokenData
|
|
|
|
let toAddress = ''
|
|
let tokenAmount = ''
|
|
|
|
if (params && params.length === 2) {
|
|
[{ value: toAddress }, { value: tokenAmount }] = params
|
|
}
|
|
|
|
return {
|
|
toAddress,
|
|
tokenAddress,
|
|
tokenAmount,
|
|
tokenSymbol,
|
|
}
|
|
}
|
|
|
|
export default connect(mapStateToProps)(ConfirmApprove)
|
|
|