In this video, we review how to use the custom hooks we've built to interact with Moralis and display relevant token data. The focus here is on functionality, so we’ll briefly touch on HTML/CSS but won’t go into detail.
The index page is the entry point of the application. It includes a "Connect Wallet" button that uses our useAuthentication hook.
On the Balances page:
Token data is fetched through our useBalances hook, which returns:
A loading message is shown until data is available. Once fetched, each token is rendered with a card, and the native token balance is displayed as plain text.
The Meet page acts as a simple token-gated area. We check if the user’s native token balance is a number greater than zero:
This can later be extended to include actual gated features such as video access or exclusive content.
In the Fun Tokens section, we use the useTokenMetadata hook to fetch metadata for all available tokens.
Each token is displayed with:
This is a more detailed version of the TokenCard used in the Balances section, handling cases where data might be null or malformed.
In the App component:
This global context is essential for maintaining a seamless user experience across pages.
This video demonstrated how to:
Swap insights and ask questions about “Learn everything about Chiliz”.
Ask a question or share your thoughts about this lesson.