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

feat: improve switch chain UX, add L2 networks & Zerion, refactor code #82

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

theshadowagent
Copy link
Member

No description provided.

@vercel
Copy link

vercel bot commented Oct 14, 2022

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

Name Status Preview Updated
nftcomponents ✅ Ready (Inspect) Visit Preview Oct 14, 2022 at 4:35PM (UTC)

@theshadowagent theshadowagent changed the title feat: improve switch chain UX, added L2 networks & Zerion feat: improve switch chain UX, added L2 networks & Zerion, refactor code Oct 14, 2022
@theshadowagent theshadowagent changed the title feat: improve switch chain UX, added L2 networks & Zerion, refactor code feat: improve switch chain UX, add L2 networks & Zerion, refactor code Oct 14, 2022
@what-the-diff
Copy link

what-the-diff bot commented Feb 19, 2023

  • Added Web3ContextProvider to wrap the app
  • Moved wallet logic from MintModal component into QuantityModalStep and ConfirmTxStep components
  • Added a new hook to get web3 instance and provider
  • Moved the logic of getting current address from wallet.js into its own function in order for it to be used by other components as well (e.g: mint)
  • Updated connectWallet() so that when user connects, we can call onConnectSuccess callback with their account address if provided
  • Removed isMobileOnlyInjectedProvider parameter from initWeb3Modal since this value will always be true or false based on whether window?ethereum exists or not
    5a-b) Refactored setContracts() so that instead of passing shouldSwitchNetwork=true/false, you pass an object {shouldSwitchNetwork = true} which allows us to add more parameters later without breaking existing code using this method (i've added one already called "onNetworkSwitch" which gets called after network switch happens). This also makes it easier for users who want default behaviour but still need access to some params like chainID etc... they just have to do something like await setContracts({chainId}) instead of having multiple optional arguments passed around everywhere! :)
  • The embed.html file was deleted
  • The index.js file was also deleted

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.

1 participant