import React from 'react'; import translate from 'translations'; import { UnitDropDown, SendEverything } from 'components'; import { Input } from 'components/ui'; import { AmountFieldFactory } from './AmountFieldFactory'; interface Props { hasUnitDropdown?: boolean; hasSendEverything?: boolean; showAllTokens?: boolean; showInvalidWithoutValue?: boolean; customValidator?(rawAmount: string): boolean; } export const AmountField: React.SFC = ({ hasUnitDropdown, hasSendEverything, showAllTokens, customValidator, showInvalidWithoutValue }) => ( (
)} /> ); const isAmountValid = ( raw: string, customValidator: ((rawAmount: string) => boolean) | undefined, isValid: boolean ) => (customValidator ? customValidator(raw) : isValid);