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