2021-02-04 19:15:23 +01:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import ConfirmTransactionBase from '../confirm-transaction-base';
|
|
|
|
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,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2018-06-23 08:52:45 +02:00
|
|
|
|
|
|
|
static propTypes = {
|
|
|
|
editTransaction: PropTypes.func,
|
|
|
|
history: PropTypes.object,
|
2018-07-12 02:34:41 +02:00
|
|
|
txParams: PropTypes.object,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2018-06-23 08:52:45 +02:00
|
|
|
|
2020-11-03 00:41:28 +01:00
|
|
|
handleEdit({ txData }) {
|
2021-02-04 19:15:23 +01:00
|
|
|
const { editTransaction, history } = this.props;
|
|
|
|
editTransaction(txData);
|
|
|
|
history.push(SEND_ROUTE);
|
2018-06-23 08:52:45 +02:00
|
|
|
}
|
|
|
|
|
2020-11-03 00:41:28 +01:00
|
|
|
shouldHideData() {
|
2021-02-04 19:15:23 +01:00
|
|
|
const { txParams = {} } = this.props;
|
|
|
|
return !txParams.data;
|
2018-07-12 02:34:41 +02:00
|
|
|
}
|
|
|
|
|
2020-11-03 00:41:28 +01:00
|
|
|
render() {
|
2021-02-04 19:15:23 +01:00
|
|
|
const hideData = this.shouldHideData();
|
2018-07-12 02:34:41 +02:00
|
|
|
|
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
|
|
|
/>
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
2018-06-23 08:52:45 +02:00
|
|
|
}
|
|
|
|
}
|