Perform airdrop boilerplate

This commit is contained in:
Greg Shuflin 2022-12-07 23:16:46 -08:00
parent 8b7c7ecb33
commit b763ba9c9a

View File

@ -40,11 +40,10 @@ function Addresses(props: AddressesProps) {
} }
var num; var num;
if (isNan(numTokens) || numTokens < 0) { if (isNaN(numTokens) || numTokens < 0) {
num = 0; num = 0;
} else { } else {
num = numTokens; num = numTokens;
} }
return ( return (
@ -82,6 +81,10 @@ function AddressList({addressList}: AddressListProps) {
function App() { function App() {
const [addressList, setAddressList] = useState([]); const [addressList, setAddressList] = useState([]);
async function performAirdrop() {
console.log("Performing airdrop");
}
return ( return (
<div className="App"> <div className="App">
@ -89,7 +92,7 @@ function App() {
<p>Add an address to airdrop to:</p> <p>Add an address to airdrop to:</p>
<Addresses addressList={addressList} setAddressListFn={setAddressList}/> <Addresses addressList={addressList} setAddressListFn={setAddressList}/>
<button disabled={addressList.length == 0}>Perform Airdrop!</button> <button disabled={addressList.length == 0} onClick={performAirdrop} >Perform Airdrop!</button>
<AddressList addressList={addressList} /> <AddressList addressList={addressList} />
</div> </div>