2018-06-23 08:52:45 +02:00
|
|
|
import React, { Component } from 'react'
|
|
|
|
import PropTypes from 'prop-types'
|
|
|
|
import ConfirmTransactionBase from '../confirm-transaction-base'
|
2019-03-22 00:03:30 +01:00
|
|
|
import { SEND_ROUTE } from '../../helpers/constants/routes'
|
2018-06-23 08:52:45 +02:00
|
|
|
|
|
|
|
export default class ConfirmSendEther extends Component {
|
|
|
|
static contextTypes = {
|
|
|
|
t: PropTypes.func,
|
|
|
|
}
|
|
|
|
|
|
|
|
static propTypes = {
|
|
|
|
editTransaction: PropTypes.func,
|
|
|
|
history: PropTypes.object,
|
2018-07-12 02:34:41 +02:00
|
|
|
txParams: PropTypes.object,
|
2018-06-23 08:52:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
handleEdit ({ txData }) {
|
|
|
|
const { editTransaction, history } = this.props
|
|
|
|
editTransaction(txData)
|
|
|
|
history.push(SEND_ROUTE)
|
|
|
|
}
|
|
|
|
|
2018-07-12 02:34:41 +02:00
|
|
|
shouldHideData () {
|
|
|
|
const { txParams = {} } = this.props
|
|
|
|
return !txParams.data
|
|
|
|
}
|
|
|
|
|
2018-06-23 08:52:45 +02:00
|
|
|
render () {
|
2018-07-12 02:34:41 +02:00
|
|
|
const hideData = this.shouldHideData()
|
|
|
|
|
2018-06-23 08:52:45 +02:00
|
|
|
return (
|
|
|
|
<ConfirmTransactionBase
|
2019-04-08 16:02:51 +02:00
|
|
|
actionKey={'confirm'}
|
2018-07-12 02:34:41 +02:00
|
|
|
hideData={hideData}
|
2018-06-23 08:52:45 +02:00
|
|
|
onEdit={confirmTransactionData => this.handleEdit(confirmTransactionData)}
|
|
|
|
/>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|