import React, { Component } from 'react' import PropTypes from 'prop-types' import { MIN_GAS_PRICE_DEC, MIN_GAS_LIMIT_DEC, } from '../../../send/send.constants' import GasSlider from '../../gas-slider' import TimeRemaining from './time-remaining' export default class AdvancedTabContent extends Component { static contextTypes = { t: PropTypes.func, } static propTypes = { updateCustomGasPrice: PropTypes.func, updateCustomGasLimit: PropTypes.func, customGasPrice: PropTypes.number, customGasLimit: PropTypes.number, millisecondsRemaining: PropTypes.number, } gasInput (value, onChange, min, precision, showGWEI) { return (
onChange(Number(event.target.value))} /> {showGWEI ? GWEI : null}
) } infoButton (onClick) { return } render () { const { updateCustomGasPrice, updateCustomGasLimit, millisecondsRemaining, customGasPrice, customGasLimit, } = this.props return (
New Transaction Fee ~Transaction Time
$0.30
Live Transaction Fee Predictions
{ updateCustomGasPrice(Number(value)) }} lowLabel={'Cheaper'} highLabel={'Faster'} value={customGasPrice} step={0.1} max={200} min={0} coloredStart={{}} />
Gas Price { this.infoButton(() => {}) }
{ this.gasInput(customGasPrice, updateCustomGasPrice, MIN_GAS_PRICE_DEC, 9, true) }
Gas Limit { this.infoButton(() => {}) }
{ this.gasInput(customGasLimit, updateCustomGasLimit, MIN_GAS_LIMIT_DEC, 0) }
) } }