rainbowkit
rainbowkit copied to clipboard
feat: `showCurrentChain` prop for `<ConnectButton />`
Changes
- Added
showCurrentChainprop to always show the current chain without having to open the chain modal
What to test
- Pass in
showCurrentChainprop to<ConnectButton />by using responsive values likelargeScreen,smallScreenand even just a plain boolean. Make sure it works as expected in the example app
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 |
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
noneonchainStatusreactive values (though I don't think many would) - I thought about maybe adding a
chainVisibilityprop and type to replace thenoneinchainStatus, and to support the usecase with the chain indicator appears even before the user connects withalways, but that still feels like an unusual edge case for most devs
Closing this PR in favor of https://github.com/rainbow-me/rainbowkit/pull/1806