In this video, we continue building our AirDrop dApp for digital collectibles using the DecentSDK. We add a loading state for when the airdrop transaction is in progress. When someone clicks the airdrop button, it will become disabled, preventing users from spamming the button and getting their wallets stuck. Additionally, we refactor our code by abstracting all the code we've previously written into the index.tsx page into its own reusable react component. By the end of this video, you'll have a more user-friendly and maintainable Airdrop button. Let's get started!
0:00 - intro
0:20 - overview
1:43 - AirdropButton component
2:40 - copy code
5:00 - loading state variable
5:24 - disabled logic
7:30 - try / catch for transaction
7:55 - onClick loading logic
Decent.xyz
- To start building your AirDrop dApp, check out the Airdrop Starter on Github: https://github.com/decentxyz/airdrop-...
- Want to learn more about Decent and stay up to date on the latest developments? Head to Decent HQ: https://hq.decent.xyz/
- For more resources and code examples, check out Decent's Github page: https://github.com/decentxyz
- And if you're interested in the AI side of things, check out Decent's AI page: https://ai.decent.xyz
- And for those who are new to the Decent ecosystem, don't forget to check out Decent Starter: https://github.com/decentxyz/Start-De..., which includes both the DecentSDK and RainbowKit to help you get started quickly and easily.
Watch video Building an AirDrop dApp for Digital Collectibles: Loading State and Code Refactoring online without registration, duration hours minute second in high quality. This video was added by user on chain experiments 20 January 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 19 once and liked it 0 people.