mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-24 19:10:22 +01:00
29 lines
648 B
JavaScript
29 lines
648 B
JavaScript
|
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)
|