componentDidMount calls enableWeb3() which sets state for metamaskEnabled and sets accounts to the user's wallet address.
When the user selects an animal using the "Donate" button, donateId is set, and the modal appears.
The donate with "ETH" button calls handleDonateETH() which on error will set errorMessage to noWeb3ErrorMessage. On success, a MetaMask popup will appear asking the user to sign the transaction.
handleDonateETH()
componentDidMount
callsenableWeb3()
which sets state formetamaskEnabled
and setsaccounts
to the user's wallet address.donateId
is set, and the modal appears.handleDonateETH()
which on error will seterrorMessage
tonoWeb3ErrorMessage
. On success, a MetaMask popup will appear asking the user to sign the transaction.7 #4