2021-02-04 19:15:23 +01:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import SendRowWrapper from '../send-row-wrapper';
|
|
|
|
import AdvancedGasInputs from '../../../../components/app/gas-customization/advanced-gas-inputs';
|
2021-06-23 23:35:25 +02:00
|
|
|
import { GAS_INPUT_MODES } from '../../../../ducks/send';
|
2018-04-11 16:21:54 +02:00
|
|
|
|
|
|
|
export default class SendGasRow extends Component {
|
|
|
|
static propTypes = {
|
2021-06-23 23:35:25 +02:00
|
|
|
updateGasPrice: PropTypes.func,
|
|
|
|
updateGasLimit: PropTypes.func,
|
|
|
|
gasInputMode: PropTypes.oneOf(Object.values(GAS_INPUT_MODES)),
|
2019-04-17 21:15:13 +02:00
|
|
|
gasPrice: PropTypes.string,
|
|
|
|
gasLimit: PropTypes.string,
|
2019-02-06 01:24:28 +01:00
|
|
|
insufficientBalance: PropTypes.bool,
|
2021-06-23 23:35:25 +02:00
|
|
|
minimumGasLimit: PropTypes.string,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2018-04-11 16:21:54 +02:00
|
|
|
|
2018-07-02 04:09:28 +02:00
|
|
|
static contextTypes = {
|
|
|
|
t: PropTypes.func,
|
2021-06-21 21:02:51 +02:00
|
|
|
trackEvent: PropTypes.func,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2018-07-02 04:09:28 +02:00
|
|
|
|
2021-08-03 01:53:13 +02:00
|
|
|
render() {
|
2018-04-11 16:21:54 +02:00
|
|
|
const {
|
2021-06-23 23:35:25 +02:00
|
|
|
updateGasPrice,
|
|
|
|
updateGasLimit,
|
2019-02-06 01:24:28 +01:00
|
|
|
gasPrice,
|
|
|
|
gasLimit,
|
|
|
|
insufficientBalance,
|
2021-06-23 23:35:25 +02:00
|
|
|
minimumGasLimit,
|
2021-08-03 01:53:13 +02:00
|
|
|
gasInputMode,
|
2021-02-04 19:15:23 +01:00
|
|
|
} = this.props;
|
2018-04-11 16:21:54 +02:00
|
|
|
|
2021-08-03 01:53:13 +02:00
|
|
|
if (gasInputMode !== GAS_INPUT_MODES.INLINE) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<SendRowWrapper>
|
2019-12-03 17:35:44 +01:00
|
|
|
<AdvancedGasInputs
|
2021-06-23 23:35:25 +02:00
|
|
|
updateCustomGasPrice={updateGasPrice}
|
|
|
|
updateCustomGasLimit={updateGasLimit}
|
2019-12-03 17:35:44 +01:00
|
|
|
customGasPrice={gasPrice}
|
|
|
|
customGasLimit={gasLimit}
|
|
|
|
insufficientBalance={insufficientBalance}
|
2021-06-23 23:35:25 +02:00
|
|
|
minimumGasLimit={minimumGasLimit}
|
2019-12-03 17:35:44 +01:00
|
|
|
customPriceIsSafe
|
|
|
|
isSpeedUp={false}
|
|
|
|
/>
|
2021-08-03 01:53:13 +02:00
|
|
|
</SendRowWrapper>
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
2018-04-11 16:21:54 +02:00
|
|
|
}
|
|
|
|
}
|