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