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

Replace library of useActiveWeb3React with wagmi hook #1374

Merged

Conversation

nkrulikovsky
Copy link
Contributor

No description provided.

@nkrulikovsky nkrulikovsky marked this pull request as ready for review May 21, 2023 22:01
@nkrulikovsky nkrulikovsky marked this pull request as draft May 22, 2023 09:28
@nkrulikovsky nkrulikovsky changed the title Replace library on use active web3 react Replace library of useActiveWeb3React with wagmi hook May 22, 2023
@nkrulikovsky nkrulikovsky force-pushed the replace-library-on-useActiveWeb3React branch from 8e0f781 to d24c959 Compare May 26, 2023 22:28
@nkrulikovsky nkrulikovsky requested a review from hammeiam May 27, 2023 11:57
@nkrulikovsky nkrulikovsky marked this pull request as ready for review May 27, 2023 11:58
image: getTokenIconPath(token.symbol),
},
},
if (activeConnector && isMetaMask && token) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this the same as canAdd?

Copy link
Contributor Author

@nkrulikovsky nkrulikovsky May 29, 2023

Choose a reason for hiding this comment

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

Even though canAdd is containing isMetaMask && token as implicitly, but typescript don't recognize it.
So, I think it would be good to keep it.

const { library } = useActiveWeb3React()
const { data: signer } = useSigner()
const provider = useProvider()
const signerOrProvider = signer || provider
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not use signerOrProvider from useActiveWeb3React?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

While debugging, I used signer and provider separately. We can usesignerOrProvider.

if (!childGaugeFactoryAddress)
throw new Error("Unable to retrieve and build gauge data")
if (!childGaugeFactoryAddress) return
// throw new Error("Unable to retrieve and build gauge data")
Copy link
Contributor

Choose a reason for hiding this comment

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

Now that you're done debugging, should this error be added back in?

src/index.tsx Outdated
@@ -1,27 +1,21 @@
import "./index.css"
import "./i18n"

import * as Sentry from "@sentry/react"
// import * as Sentry from "@sentry/react"
Copy link
Contributor

Choose a reason for hiding this comment

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

Add sentry back in

<>
<TopMenu />
<Suspense fallback={null}>
<LocalizationProvider dateAdapter={AdapterDateFns}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not keep LocalizationProvider on the outside?

@@ -72,6 +75,8 @@ function Pools(): ReactElement | null {
})
}, [account, chainId])

if (isConnecting) return <div> Loading ...</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

If you're going to display a loading state, can you create a better component for it than this?

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 added this while debugging of underlying netowork connection, but these are not related that issue and we don't have much need to displaying loading component while connect account. So, I'll remove this lines.

@nkrulikovsky nkrulikovsky self-assigned this May 29, 2023
@hammeiam hammeiam merged commit 648be5d into rainbowkit-integration Jun 1, 2023
hammeiam added a commit that referenced this pull request Jun 2, 2023
* Add RainbowKit and Wagmi dependencies to package.json

* Configure wagmi and rainbow-me

* Add Tally wallet to the list of popular wallets in config.ts

* allow undefined alchemyKey

* Rainbow install and wagmi configuration (#1366)

* hide fusdc deprecated gauges from vote (#1367)

* fix one token withdraw, correct apy display (#1368)

* Rainbow install and wagmi configuration (#1366)

* Wagmi provider (#1370)

* Add wagmi config and Rainbowkit provider

* update wagmi and rainbowkit version and updated config file of wagmi

* Update package.json and config.ts to use updated versions of "@rainbow-me/rainbowkit" and "wagmi", respectively, and remove unused CoinbasePayTest page

* Remove redundant parameter in getContract function for better readability

* Update walletconnect button (#1371)

* Add wagmi config and Rainbowkit provider

* update wagmi and rainbowkit version and updated config file of wagmi

* feat: Replace Wallet connect button using Rainbotkit ConnectButton

* Update package.json and config.ts to use updated versions of "@rainbow-me/rainbowkit" and "wagmi", respectively, and remove unused CoinbasePayTest page

* Lint fix

* Update ci to trigger ci/cd

* Replace library of useActiveWeb3React with wagmi hook (#1374)

* Add wagmi config and Rainbowkit provider

* update wagmi and rainbowkit version and updated config file of wagmi

* feat: Replace Wallet connect button using Rainbotkit ConnectButton

* Update package.json and config.ts to use updated versions of "@rainbow-me/rainbowkit" and "wagmi", respectively, and remove unused CoinbasePayTest page

* update useActiveWeb3React with wagmi hook

* Update useActiveWeb3React with wagmi hook

* remove web3-react completely

* ci updte

* Refactor Web3Status component to conditionally render IconButton or Button based on whether or not chain has an icon

* replace library of useActiveWeb3React with signer or provider from wagmi hook

* Refactor useContract hook to useActiveWeb3React instead of individual useAccount, useProvider, and useSigner hooks for cleaner code

* Re Add Sentry initialization in index.tsx to enable error tracking and tracing

* Refactor AppContainer and Pools components to remove unused imports and variables

* Add back  error handling for missing childGaugeFactoryAddress in buildGaugeDataSidechain

* Refactor usePoolRegistryMultiCall to useActiveWeb3React for signerOrProvider

* recover  ci/cd setting

* remove husky change

* add buffer polyfill

* add prod infura key

* remove viem

---------

Co-authored-by: David Hamme <dhamme@gmail.com>
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