-
Notifications
You must be signed in to change notification settings - Fork 119
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
Capsule integration final #883
base: main
Are you sure you want to change the base?
Conversation
…usecapsule-integration-two
Deploying ens-app-v3 with Cloudflare Pages
|
…capsule-integration-final
Default to moonpay when balance is zero
…capsule-integration-final
src/components/ConnectButton.tsx
Outdated
const isCapsuleConnected = getIsCapsuleConnected(wagmiConfig.state) | ||
|
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.
would this be better suited to use with wagmi's useConnections
?
src/components/ConnectButton.tsx
Outdated
isCapsuleConnected | ||
? { | ||
label: t('wallet.myWallet'), | ||
color: 'text', | ||
icon: <WalletSVG />, | ||
wrapper: (children: ReactNode, key: Key) => ( | ||
<BaseLink href="https://connect.usecapsule.com/" key={key}> | ||
{children} | ||
</BaseLink> | ||
), | ||
} | ||
: null, |
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 use ...[isCapsuleConnected ? [...] : []]
you can avoid filtering
src/pages/_app.tsx
Outdated
|
||
import '@rainbow-me/rainbowkit/styles.css' | ||
|
||
// prettier-ignore-file |
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.
remove
|
||
const rainbowKitTheme: Theme = { | ||
...lightTheme({ | ||
// accentColor: thorinLightTheme.colors.accent, // requires a hex string color but thorinLightTheme returns a hsl string |
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.
fix
src/utils/query/capsuleWallet.ts
Outdated
githubUrl: 'https://github.com/ensdomains', | ||
xUrl: 'https://twitter.com/ensdomains', |
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.
we have these elsewhere i think, would be nice to have a single reference
src/utils/query/capsuleWallet.ts
Outdated
githubUrl: 'https://github.com/ensdomains', | ||
xUrl: 'https://twitter.com/ensdomains', | ||
homepageUrl: 'https://ens.domains/', | ||
supportUrl: 'mailto:[email protected]', |
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 a real email?
const isSupportedChain = (chainId: number): chainId is (typeof chains)[number]['id'] => | ||
chains.some((c) => c.id === chainId) | ||
|
||
// hotfix for wagmi bug | ||
wagmiConfig_.subscribe( | ||
({ connections, current }) => (current ? connections.get(current)?.chainId : undefined), | ||
(chainId_) => { | ||
const chainId = chainId_ || chains[0].id | ||
// If chain is not configured, then don't switch over to it. | ||
const isChainConfigured = isSupportedChain(chainId) | ||
if (!isChainConfigured) return | ||
|
||
return wagmiConfig_.setState((x) => ({ | ||
...x, | ||
chainId: chainId ?? x.chainId, | ||
})) | ||
}, | ||
) | ||
|
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.
we still need these unless they went somewhere else, our logic means we're always defaulting to the 0th item in the chain array (without it it'll stay on the last connected supported chain)
…capsule-integration-final
Quality Gate passedIssues Measures |
Quality Gate passedIssues Measures |
No description provided.