Closed gvnut closed 1 year ago
I edited the CampaignDetails.jsx file to add a conditional statement to check if the amount variable is an empty string before allowing the button to be clicked. I added an alert using the window.alert() function.
Here is an example of how you can modify the handleDonate function:
const handleDonate = async () => { if (amount === '') { window.alert('Please enter a donation amount'); return; } setIsLoading(true);
await donate(state.pId, amount);
navigate('/') setIsLoading(false); }
There is an issue where on the CampaignDetails.jsx page if you click the donation button without inputting any ether amount, it will throw the loading screen. But it will never time out or complete as there was no amount input.