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.
40 lines
954 B
40 lines
954 B
7 years ago
|
import React, { Component } from 'react'
|
||
|
import PropTypes from 'prop-types'
|
||
|
import ConfirmTransactionBase from '../confirm-transaction-base'
|
||
6 years ago
|
import { SEND_ROUTE } from '../../helpers/constants/routes'
|
||
7 years ago
|
|
||
|
export default class ConfirmSendEther extends Component {
|
||
|
static contextTypes = {
|
||
|
t: PropTypes.func,
|
||
|
}
|
||
|
|
||
|
static propTypes = {
|
||
|
editTransaction: PropTypes.func,
|
||
|
history: PropTypes.object,
|
||
6 years ago
|
txParams: PropTypes.object,
|
||
7 years ago
|
}
|
||
|
|
||
|
handleEdit ({ txData }) {
|
||
|
const { editTransaction, history } = this.props
|
||
|
editTransaction(txData)
|
||
|
history.push(SEND_ROUTE)
|
||
|
}
|
||
|
|
||
6 years ago
|
shouldHideData () {
|
||
|
const { txParams = {} } = this.props
|
||
|
return !txParams.data
|
||
|
}
|
||
|
|
||
7 years ago
|
render () {
|
||
6 years ago
|
const hideData = this.shouldHideData()
|
||
|
|
||
7 years ago
|
return (
|
||
|
<ConfirmTransactionBase
|
||
|
action={this.context.t('confirm')}
|
||
6 years ago
|
hideData={hideData}
|
||
7 years ago
|
onEdit={confirmTransactionData => this.handleEdit(confirmTransactionData)}
|
||
|
/>
|
||
|
)
|
||
|
}
|
||
|
}
|