/* @flow */ 'use strict'; import React from 'react'; import Tooltip from 'rc-tooltip'; const AdvancedForm = (props: any): any => { const { coin, token, gasPrice, gasLimit, data, errors, warnings, infos, advanced } = props.sendForm; const { toggleAdvanced, onGasPriceChange, onGasLimitChange, onDataChange } = props.sendFormActions; if (!advanced) return (
Advanced settings { props.children }
); const gasLimitTooltip = (
Gas limit is the amount of gas to send with your transaction.
TX fee = gas price * gas limit & is paid to miners for including your TX in a block.
Increasing this number will not get your TX mined faster.
Default value for sending ETH is { gasLimit } WEI.
); const gasPriceTooltip = (
Gas Price is the amount you pay per unit of gas.
TX fee = gas price * gas limit & is paid to miners for including your TX in a block.
Higher the gas price = faster transaction, but more expensive. Default is { gasPrice } GWEI.
Read more
); const dataTooltip = (
Data is usually used when you send transactions to contracts.
); return (
Advanced settings
} overlay={ gasLimitTooltip } placement="top"> onGasLimitChange(event.target.value) } /> { errors.gasLimit ? ({ errors.gasLimit }) : null } { warnings.gasLimit ? ({ warnings.gasLimit }) : null }
} overlay={ gasPriceTooltip } placement="top"> onGasPriceChange(event.target.value) } /> { errors.gasPrice ? ({ errors.gasPrice }) : null }
} overlay={ dataTooltip } placement="top"> { errors.data ? ({ errors.data }) : null }
{ props.children }
) } export default AdvancedForm;