Building an AirDrop dApp for Digital Collectibles: Loading State and Code Refactoring

Опубликовано: 20 Январь 2023
на канале: on chain experiments
19
0

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.


Смотрите видео Building an AirDrop dApp for Digital Collectibles: Loading State and Code Refactoring онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь on chain experiments 20 Январь 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 19 раз и оно понравилось 0 людям.