@ -4,9 +4,9 @@ import Box from 'components/base/Box'
import Label from 'components/base/Label'
import RequestAmount from 'components/RequestAmount'
class AmountField extends Component < * , { canBeSpent Error: ? Error } > {
class AmountField extends Component < * , { validTransaction Error: ? Error } > {
state = {
canBeSpent Error: null ,
validTransaction Error: null ,
}
componentDidMount ( ) {
this . resync ( )
@ -27,11 +27,11 @@ class AmountField extends Component<*, { canBeSpentError: ?Error }> {
const { account , bridge , transaction } = this . props
const syncId = ++ this . syncId
try {
await bridge . checkCanBeSpent ( account , transaction )
await bridge . checkValidTransaction ( account , transaction )
if ( this . syncId !== syncId ) return
this . setState ( { canBeSpent Error: null } )
} catch ( canBeSpent Error) {
this . setState ( { canBeSpent Error } )
this . setState ( { validTransaction Error: null } )
} catch ( validTransaction Error) {
this . setState ( { validTransaction Error } )
}
}
@ -42,14 +42,14 @@ class AmountField extends Component<*, { canBeSpentError: ?Error }> {
render ( ) {
const { bridge , account , transaction , t } = this . props
const { canBeSpent Error } = this . state
const { validTransaction Error } = this . state
return (
< Box flow = { 1 } >
< Label > { t ( 'app:send.steps.amount.amount' ) } < / L a b e l >
< RequestAmount
withMax = { false }
account = { account }
canBeSpentError = { canBeSpent Error}
validTransactionError = { validTransaction Error}
onChange = { this . onChange }
value = { bridge . getTransactionAmount ( account , transaction ) }
/ >