-
Notifications
You must be signed in to change notification settings - Fork 61
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
Replace library of useActiveWeb3React with wagmi hook #1374
Conversation
…ow-me/rainbowkit" and "wagmi", respectively, and remove unused CoinbasePayTest page
…utton based on whether or not chain has an icon
8e0f781
to
d24c959
Compare
image: getTokenIconPath(token.symbol), | ||
}, | ||
}, | ||
if (activeConnector && isMetaMask && token) { |
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.
Is this the same as canAdd
?
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.
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.
src/hooks/useContract.ts
Outdated
const { library } = useActiveWeb3React() | ||
const { data: signer } = useSigner() | ||
const provider = useProvider() | ||
const signerOrProvider = signer || provider |
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.
Why not use signerOrProvider
from useActiveWeb3React
?
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.
While debugging, I used signer
and provider
separately. We can usesignerOrProvider
.
src/utils/gauges.ts
Outdated
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") |
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.
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" |
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.
Add sentry back in
src/pages/AppContainer.tsx
Outdated
<> | ||
<TopMenu /> | ||
<Suspense fallback={null}> | ||
<LocalizationProvider dateAdapter={AdapterDateFns}> |
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.
Why not keep LocalizationProvider
on the outside?
src/pages/Pools/Pools.tsx
Outdated
@@ -72,6 +75,8 @@ function Pools(): ReactElement | null { | |||
}) | |||
}, [account, chainId]) | |||
|
|||
if (isConnecting) return <div> Loading ...</div> |
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 you're going to display a loading state, can you create a better component for it than this?
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.
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.
… useAccount, useProvider, and useSigner hooks for cleaner code
…GaugeDataSidechain
* 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>
No description provided.