Merge pull request #76 from lbryio/wallet-send

disable send button if the recipient address is not valid
This commit is contained in:
Akinwale Ariwodola 2019-11-06 13:42:19 +01:00 committed by GitHub
commit 56aa0a96a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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}