1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-01 21:57:06 +01:00
metamask-extension/ui/pages/send/send-content/send-gas-row/send-gas-row.component.js

54 lines
1.4 KiB
JavaScript
Raw Normal View History

import React, { Component } from 'react';
import PropTypes from 'prop-types';
import SendRowWrapper from '../send-row-wrapper';
import AdvancedGasInputs from '../../../../components/app/advanced-gas-inputs';
import { GAS_INPUT_MODES } from '../../../../ducks/send';
2018-04-11 16:21:54 +02:00
export default class SendGasRow extends Component {
static propTypes = {
updateGasPrice: PropTypes.func,
updateGasLimit: PropTypes.func,
gasInputMode: PropTypes.oneOf(Object.values(GAS_INPUT_MODES)),
gasPrice: PropTypes.string,
gasLimit: PropTypes.string,
insufficientBalance: PropTypes.bool,
minimumGasLimit: PropTypes.string,
};
2018-04-11 16:21:54 +02:00
static contextTypes = {
t: PropTypes.func,
trackEvent: PropTypes.func,
};
render() {
2018-04-11 16:21:54 +02:00
const {
updateGasPrice,
updateGasLimit,
gasPrice,
gasLimit,
insufficientBalance,
minimumGasLimit,
gasInputMode,
} = this.props;
2018-04-11 16:21:54 +02:00
if (gasInputMode !== GAS_INPUT_MODES.INLINE) {
return null;
}
return (
<SendRowWrapper>
<AdvancedGasInputs
updateCustomGasPrice={updateGasPrice}
updateCustomGasLimit={updateGasLimit}
customGasPrice={gasPrice}
customGasLimit={gasLimit}
insufficientBalance={insufficientBalance}
minimumGasLimit={minimumGasLimit}
customPriceIsSafe
isSpeedUp={false}
/>
</SendRowWrapper>
);
2018-04-11 16:21:54 +02:00
}
}