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

Allow change network standalone widget #5306

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

anxolin
Copy link
Contributor

@anxolin anxolin commented Jan 16, 2025

Summary

The widget is currently not showing the network selector. For dapp mode, is not a big deal, because the connection is handled by the dapp, and therefore, the responsibility of the network is there too.

However, in standalone mode, there's not currently a way to change network.

Screen.Recording.2025-01-16.at.21.07.11.mov

This PR does 2 things:

Adds the setting in the configurator

image

Replaces the ETH balance by the network selector

ETH can be seen already in the network selector, and we are short on space. Plus we are a "gassless" exchange, you shouldn't need Ether a lot :)

So I took the space of the ETH to show the network:
image

Copy link

vercel bot commented Jan 16, 2025

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

Name Status Preview Updated (UTC)
cosmos ✅ Ready (Inspect) Visit Preview Jan 16, 2025 9:18pm
cowfi ✅ Ready (Inspect) Visit Preview Jan 16, 2025 9:18pm
explorer-dev ✅ Ready (Inspect) Visit Preview Jan 16, 2025 9:18pm
sdk-tools ✅ Ready (Inspect) Visit Preview Jan 16, 2025 9:18pm
swap-dev ✅ Ready (Inspect) Visit Preview Jan 16, 2025 9:18pm
widget-configurator ✅ Ready (Inspect) Visit Preview Jan 16, 2025 9:18pm

Comment on lines +52 to +58
{!!hideNetworkSelector &&
standaloneMode !== false &&
account &&
!isChainIdUnsupported &&
userEthBalance &&
chainId &&
!isUpToLarge && (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These conditions are getting out of hand.
How about a variable/fn to abstract it away?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot agree more

@anxolin anxolin requested review from a team January 17, 2025 17:39
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.

2 participants