import React, { Component } from 'react' import PropTypes from 'prop-types' import GasPriceChart from '../../gas-price-chart' 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, totalFee: PropTypes.string, timeRemaining: PropTypes.string, } gasInput (value, onChange, min, precision, showGWEI) { return (
onChange(Number(event.target.value))} />
) } infoButton (onClick) { return } renderDataSummary (totalFee, timeRemaining) { return (
{ this.context.t('newTransactionFee') } ~{ this.context.t('transactionTime') }
{totalFee}
{timeRemaining}
) } renderGasEditRow (labelKey, ...gasInputArgs) { return (
{ this.context.t(labelKey) } { this.infoButton(() => {}) }
{ this.gasInput(...gasInputArgs) }
) } renderGasEditRows (customGasPrice, updateCustomGasPrice, customGasLimit, updateCustomGasLimit) { return (
{ this.renderGasEditRow('gasPrice', customGasPrice, updateCustomGasPrice, customGasPrice, 9, true) } { this.renderGasEditRow('gasLimit', customGasLimit, updateCustomGasLimit, customGasLimit, 0) }
) } render () { const { updateCustomGasPrice, updateCustomGasLimit, timeRemaining, customGasPrice, customGasLimit, totalFee, } = this.props return (
{ this.renderDataSummary(totalFee, timeRemaining) }
{ this.renderGasEditRows( customGasPrice, updateCustomGasPrice, customGasLimit, updateCustomGasLimit ) }
) } }