Skip to content

Comments

feat: add ConnectWalletButton component#1034

Closed
ByteAtATime wants to merge 1 commit intoscaffold-eth:mainfrom
ByteAtATime:feat/connect-wallet-button
Closed

feat: add ConnectWalletButton component#1034
ByteAtATime wants to merge 1 commit intoscaffold-eth:mainfrom
ByteAtATime:feat/connect-wallet-button

Conversation

@ByteAtATime
Copy link
Contributor

Description

This component makes it easier to have a button that does something that requires the user to connect their wallet. If the wallet is not connected, instead of rendering the children, it instead opens the connection modal. I find that this is a surprisingly common use case.

I would consider this a "simple" PR. If it is accepted, I'm down to write the docs for it too.

Additional Information

Your ENS/address: byteatatime.eth

This component makes it easier to have a button that does something that requires the user to connect their wallet. If the wallet is not connected, instead of rendering the `children`, it instead opens the connection modal.
@damianmarti
Copy link
Member

Thanks for the contribution @ByteAtATime !!

I tested the component and it's working well. The component should be exported in index.tsx from components/scaffold-eth too.

However, I'm not sure if this component is needed. You can get the same result by checking if the user is connected and using the RainbowKitCustomConnectButton. Maybe the RainbowKitCustomConnectButton component can receive an optional children component and show this if the user is already connected instead of the current fixed balance and address info.

I think that is better to open an issue to discuss it with the team and come up with an agreed solution.

Copy link
Collaborator

@technophile-04 technophile-04 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if the api makes sense

<ConnectWalletButton className="btn btn-primary" connectText="connect to start" onClick={handleMintNFT}>
  Mint NFT
</ConnectWalletButton>

I have to attach minting logic to connect button(the component name)?

Also lets create discussion first thanks 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants