Content pfp
Content
@
0 reply
0 recast
0 reaction

Deeksha Rungta pfp
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 pfp
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

Deeksha Rungta pfp
Deeksha Rungta
@deeksharungta
Hey Samuel, thanks for your help I want the component to be non-developer friendly so that anyone can just customise on framer whatever they want to show and that should work. With the approach you shared, I am only able to show the code components Also, thanks for the viem recommendation
1 reply
0 recast
0 reaction