Giveth / giveth-dapps-v2

This project is the aggregation of GIVeconomy and Giveth.io DApps in a single repo
https://staging.giveth.io
GNU General Public License v3.0
54 stars 32 forks source link

Show switch network modal on sign in by default when user is on unrecognized network #4271

Open GriffGreen opened 3 weeks ago

GriffGreen commented 3 weeks ago

I went to donate to the matching pool and went to click the sign in button at the top... my metamask was connected to zk sync and i got a really weird screen

Screenshot 2024-06-12 at 9 16 25 AM

I would have liked it to ask me to connect to a different network...

divine-comedian commented 2 weeks ago

When the user tries to connect with an unrecognized network we show them a default modal from web3modal, like the one pictured above. Usually the user needs to click the button that has the chainId on it, but this may not be intuitive enough for them to know where to click.

We do automatically show a clear switch network modal if they are already signed in and switch to an unrecognized network but it can be clicked out of and the user might be lost afterwards.

When the user is connected to the wrong network they can click CONNECT WALLET -> sign in splash page -> sign in with Ethereum -> we should try to show them this modal instead, if they are connected to an unknown network:

image

OR this one:

image

We should try to use either of those views and AVOID showing the web3modal view that Griff posted above, since it is pretty unhelpful for the sign in process.

MohammadPCh commented 1 week ago

Thanks @GriffGreen @divine-comedian. I've made some improvements. Can you check this link and confirm if the result is as expected? https://giveth-dapps-v2-git-fix-unsupported-network-modal-givethio.vercel.app/

divine-comedian commented 1 week ago

Tested it out, looks good to me! Let's carry on with bringing this to staging

MohammadPCh commented 1 week ago

It's on the staging now

maryjaf commented 6 days ago

STG: image

PROD: image

maryjaf commented 6 days ago

https://github.com/Giveth/giveth-dapps-v2/assets/111529185/9450c064-3976-43f0-b25a-a86f93213faf