Refactor noErrors function helper when validating forms

This commit is contained in:
apanizo 2018-11-12 16:30:21 +01:00
parent 8d9c058ac0
commit ff025ecfe6
2 changed files with 3 additions and 3 deletions

View File

@ -71,3 +71,5 @@ export const inLimit = (limit: number, base: number, baseText: string, symbol: s
return `Should not exceed ${max} ${symbol} (amount to reach ${baseText})`
}
export const noErrorsOn = (name: string, errors: Object) => errors[name] === undefined

View File

@ -3,7 +3,7 @@ import * as React from 'react'
import { withStyles } from '@material-ui/core/styles'
import Field from '~/components/forms/Field'
import TextField from '~/components/forms/TextField'
import { required, composeValidators, uniqueAddress, mustBeEthereumAddress } from '~/components/forms/validator'
import { required, composeValidators, uniqueAddress, mustBeEthereumAddress, noErrorsOn } from '~/components/forms/validator'
import Block from '~/components/layout/Block'
import Button from '~/components/layout/Button'
import Row from '~/components/layout/Row'
@ -75,8 +75,6 @@ const getAddressValidators = (addresses: string[], position: number) => {
return composeValidators(required, mustBeEthereumAddress, uniqueAddress(copy))
}
const noErrorsOn = (name: string, errors: Object) => errors[name] === undefined
export const ADD_OWNER_BUTTON = '+ ADD ANOTHER OWNER'
export const calculateValuesAfterRemoving = (index: number, notRemovedOwners: number, values: Object) => {