rainbowkit icon indicating copy to clipboard operation
rainbowkit copied to clipboard

feat: `showCurrentChain` prop for `<ConnectButton />`

Open 0xmkh opened this issue 2 years ago • 1 comments

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

0xmkh avatar Feb 22 '24 03:02 0xmkh

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

vercel[bot] avatar Feb 22 '24 03:02 vercel[bot]

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

DanielSinclair avatar Apr 04 '24 07:04 DanielSinclair

Closing this PR in favor of https://github.com/rainbow-me/rainbowkit/pull/1806

0xmkh avatar Apr 06 '24 04:04 0xmkh