disable send button if the recipient address is not valid #76
1 changed files with 3 additions and 2 deletions
|
@ -82,7 +82,8 @@ class WalletSend extends React.PureComponent<Props> {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { balance } = this.props;
|
const { balance } = this.props;
|
||||||
const canSend = this.state.address && this.state.amount > 0 && this.state.address.trim().length > 0;
|
const canSend =
|
||||||
|
this.state.address && this.state.amount > 0 && this.state.address.trim().length > 0 && this.state.addressValid;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={walletStyle.card}>
|
<View style={walletStyle.card}>
|
||||||
|
@ -94,7 +95,7 @@ class WalletSend extends React.PureComponent<Props> {
|
||||||
this.setState({
|
this.setState({
|
||||||
address: value,
|
address: value,
|
||||||
addressChanged: true,
|
addressChanged: true,
|
||||||
addressValid: value.trim().length == 0 || regexAddress.test(value),
|
addressValid: value.trim().length === 0 || regexAddress.test(value),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
onBlur={this.handleAddressInputBlur}
|
onBlur={this.handleAddressInputBlur}
|
||||||
|
|
Loading…
Reference in a new issue