Skip to content

Commit

Permalink
implemented form submission feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jpcapurro-atixlabs committed Jan 15, 2020
1 parent 21cb56d commit 61db0f0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions examples/wallet/app/components/SendTransaction.js
Expand Up @@ -28,11 +28,16 @@ export default ({
}: Props) => {
const handleSubmit = function handleSubmit(event) {
event.preventDefault();
sendFunds(destinationAddress, Number(amount));
sendFunds(destinationAddress, Number(amount))
.then(() => {
console.log('success!');
return setAmount('');
})
.catch(error => console.error('couldnt send funds: ', error));
};
const [destinationAddress, setDestinationAddress] = useState<string>('');
const [validAddress, setValidAddress] = useState<boolean>(false);
const [amount, setAmount] = useState<?number>();
const [amount, setAmount] = useState<number | ''>('');
const isValidAmount = (value, currentBalance) =>
transactionFee + value <= currentBalance &&
typeof value === 'number' &&
Expand Down

0 comments on commit 61db0f0

Please sign in to comment.