/* @flow */ 'use strict'; import React from 'react'; import Tooltip from 'rc-tooltip'; import type { Props as BaseProps } from './index'; type Props = { selectedAccount: $ElementType, sendForm: $ElementType, sendFormActions: $ElementType, children?: $ElementType, }; const AdvancedForm = (props: Props) => { const { account, network } = props.selectedAccount; const { networkSymbol, currency, gasPrice, gasLimit, calculatingGasLimit, nonce, data, errors, warnings, infos, advanced } = props.sendForm; const { toggleAdvanced, onGasPriceChange, onGasLimitChange, onNonceChange, onDataChange } = props.sendFormActions; if (!advanced) return (
Advanced settings { props.children }
); const nonceTooltip = (
Nonce is.....
); 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={ nonceTooltip } placement="top"> onNonceChange(event.target.value) } /> { errors.nonce ? ({ errors.nonce }) : null } { warnings.nonce ? ({ warnings.nonce }) : null }
*/}
} overlay={ gasLimitTooltip } placement="top"> 0 } onChange={ event => onGasLimitChange(event.target.value) } /> { errors.gasLimit ? ({ errors.gasLimit }) : null } { warnings.gasLimit ? ({ warnings.gasLimit }) : null } { calculatingGasLimit ? (Calculating...) : 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;