-
Notifications
You must be signed in to change notification settings - Fork 685
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: chain modal v2 #1709
feat: chain modal v2 #1709
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This is awesome to have. Another feature I'd like to have is the ability to pass a |
Thank you, great addition to RainbowKit! |
@0xartcro We can probably add an extra prop that says |
packages/rainbowkit/src/components/RainbowKitProvider/AuthenticationContext.tsx
Outdated
Show resolved
Hide resolved
packages/rainbowkit/src/components/RainbowKitProvider/AuthenticationContext.tsx
Show resolved
Hide resolved
openChainModal: | ||
connectionStatus === 'connected' ? openChainModal : undefined, | ||
connectionStatus === 'connected' || | ||
connectionStatus === 'disconnected' | ||
? openChainModal | ||
: undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To keep it simple we don't want to open chain modal if the connection status is either loading
or unauthenticated
. This is primarily used for our authentication provider.
-
loading
= fetching user -
unauthenticated
= when the user has connected their wallet, but hasn't signed in -
connected
= if user is logged in via siwe provider or has connected their wallet without using siwe auth provider -
disconnected
= if user's wallet is disconnected
@@ -133,7 +136,7 @@ export function ConnectButtonRenderer({ | |||
iconUrl: resolvedChainIconUrl, | |||
id: chainId, | |||
name: chainName, | |||
unsupported: !isCurrentChainSupported, | |||
unsupported: isConnected && !isCurrentChainSupported, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only show unsupported
if a user is connected and if the chain is not supported
Finally! Been asking for this for so long, ha! Looking forward to it! Q: Will this retain the functionality to programmatically switch chains even if the users aren't connected? (if not, consider it a feature request!) |
c866999
to
e1e02c1
Compare
@@ -287,6 +289,7 @@ function RainbowKitApp({ | |||
...demoAppInfo, | |||
...(showDisclaimer && { disclaimer: DisclaimerDemo }), | |||
}} | |||
ignoreChainModalOnConnect={ignoreChainModalOnConnect} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If user doesn't want to have the chain modal before connection then they can provide ignoreChainModalOnConnect
prop. This will sometimes help the UX since otherwise wallets have to connect + switch to the desired chain that they've choosen.
Some people are just interested to have the connect modal. This will prevent the switch chain prompt during wallet connection.
So can this be merged so I can see whether it fixes the no chains issue? @kosmoskey |
When is this expected to merge? We are planning to migrate to RainbowKit but waiting for this PR to be merged as this is open since long time now. |
@Morgosh @ShivamDev31 This will be merged soon. We wanted to introduce less UI changes first during RainbowKit 2.0, but we will prioritise this. |
I have to ask, what happened to this? I'm very much looking forward to this @DanielSinclair. |
Might be just auto-closed because @kosmoskey is it still planned to be merged? |
@0xartcro Yes srry we will raise another PR to |
Changes
siwe
.initialChain
instead.initialChain
, the option to change networks will be hidden to prevent accidental switches.Screen recordings / screenshots
chain-modal-v2.mov
What to test
initialChain
and check if the chain button is no longer visible.siwe
. Test this connecting to your wallet first and then you should see chain button dissapear. This prevents users from switching chains with their connected wallet when they are not signed in yet.