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
|
|
|
}
|
|
|
|
|
2020-11-03 00:41:28 +01:00
|
|
|
handleEdit({ txData }) {
|
2018-06-23 08:52:45 +02:00
|
|
|
const { editTransaction, history } = this.props
|
|
|
|
editTransaction(txData)
|
|
|
|
history.push(SEND_ROUTE)
|
|
|
|
}
|
|
|
|
|
2020-11-03 00:41:28 +01:00
|
|
|
shouldHideData() {
|
2018-07-12 02:34:41 +02:00
|
|
|
const { txParams = {} } = this.props
|
|
|
|
return !txParams.data
|
|
|
|
}
|
|
|
|
|
2020-11-03 00:41:28 +01: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-11-18 16:08:47 +01:00
|
|
|
actionKey="confirm"
|
2018-07-12 02:34:41 +02:00
|
|
|
hideData={hideData}
|
2020-11-03 00:41:28 +01:00
|
|
|
onEdit={(confirmTransactionData) =>
|
|
|
|
this.handleEdit(confirmTransactionData)
|
|
|
|
}
|
2018-06-23 08:52:45 +02:00
|
|
|
/>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|