Content
@
0 reply
0 recast
0 reaction
Deeksha Rungta
@deeksharungta
hello hello, I want to know if there’s a way to change the variant of a component from code based on certain conditions. To give more context, I’m trying to build a "Connect Wallet" button that will be used to show gated content if the user holds a specific token/NFT in a certain quantity. I have finished the logic to check for the token, but I just need a way to make it a token-gated component. I’d love to know other ways to achieve this as well. Here’s the link to the code for the component: https://gist.github.com/deeksharungta/46ef4ca12427769d5ab74c250a81c2c5
1 reply
0 recast
2 reactions
Samuel
@samuellhuber.eth
https://gist.github.com/deeksharungta/46ef4ca12427769d5ab74c250a81c2c5#file-gistfile1-txt-L160 that line you can add state if the user has the token or not and then adjust which component is shown there. also advocating for viem.sh usage over web3, but that's not relevant to the UI shown
1 reply
0 recast
2 reactions