2018-06-23 08:52:45 +02:00
|
|
|
import React, { Component } from 'react'
|
|
|
|
import PropTypes from 'prop-types'
|
|
|
|
import ConfirmTransactionBase from '../confirm-transaction-base'
|
|
|
|
import { SEND_ROUTE } from '../../../routes'
|
|
|
|
|
|
|
|
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
|
|
|
|
action={this.context.t('confirm')}
|
2018-07-12 02:34:41 +02:00
|
|
|
hideData={hideData}
|
2018-06-23 08:52:45 +02:00
|
|
|
onEdit={confirmTransactionData => this.handleEdit(confirmTransactionData)}
|
|
|
|
/>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|