disable send button if the recipient address is not valid #76

Merged
akinwale merged 1 commit from wallet-send into master 2019-11-06 13:42:20 +01:00

View file

@ -82,7 +82,8 @@ class WalletSend extends React.PureComponent<Props> {
render() {
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 (
<View style={walletStyle.card}>
@ -94,7 +95,7 @@ class WalletSend extends React.PureComponent<Props> {
this.setState({
address: value,
addressChanged: true,
addressValid: value.trim().length == 0 || regexAddress.test(value),
addressValid: value.trim().length === 0 || regexAddress.test(value),
})
}
onBlur={this.handleAddressInputBlur}