Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: showCurrentChain prop for <ConnectButton /> #1793

Closed
wants to merge 5 commits into from

Conversation

magiziz
Copy link
Contributor

@magiziz magiziz commented Feb 22, 2024

Changes

  • Added showCurrentChain prop to always show the current chain without having to open the chain modal

What to test

  1. Pass in showCurrentChain prop to <ConnectButton /> by using responsive values like largeScreen, smallScreen and even just a plain boolean. Make sure it works as expected in the example app

@magiziz magiziz requested a review from a team as a code owner February 22, 2024 03:19
Copy link

vercel bot commented Feb 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rainbowkit-example ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 11, 2024 11:16pm
rainbowkit-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 11, 2024 11:16pm

@DanielSinclair
Copy link
Contributor

DanielSinclair commented Apr 4, 2024

I'm not quite sold on this one. When experimenting, if showCurrentChain is active when multiple chains are available, you lose the ability to switch chains. This prop also clashes with chainStatus and it isn't immediately clear to someone reading the types or docs why they're different.

My alternative proposal:

  • Change the behavior so that the chain button (without hover, click reaction or drop-down) is visible after connection even when just 1 chain is available
  • Users can override this new default with none on chainStatus reactive values (though I don't think many would)
  • I thought about maybe adding a chainVisibility prop and type to replace the none in chainStatus, and to support the usecase with the chain indicator appears even before the user connects with always, but that still feels like an unusual edge case for most devs

@magiziz
Copy link
Contributor Author

magiziz commented Apr 6, 2024

Closing this PR in favor of #1806

@magiziz magiziz closed this Apr 6, 2024
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.

[bug] Chains not shown for Connect Button if only one chain
3 participants