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

Capsule integration final #883

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

Conversation

LeonmanRolls
Copy link
Member

No description provided.

Copy link

cloudflare-workers-and-pages bot commented Sep 25, 2024

Deploying ens-app-v3 with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8521a2a
Status: ✅  Deploy successful!
Preview URL: https://ca3c9e1b.ens-app-v3.pages.dev
Branch Preview URL: https://capsule-integration-final.ens-app-v3.pages.dev

View logs

Comment on lines 157 to 158
const isCapsuleConnected = getIsCapsuleConnected(wagmiConfig.state)

Copy link
Collaborator

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?

Comment on lines 199 to 210
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,
Copy link
Collaborator

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


import '@rainbow-me/rainbowkit/styles.css'

// prettier-ignore-file
Copy link
Collaborator

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
Copy link
Collaborator

Choose a reason for hiding this comment

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

fix

Comment on lines 26 to 27
githubUrl: 'https://github.com/ensdomains',
xUrl: 'https://twitter.com/ensdomains',
Copy link
Collaborator

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

githubUrl: 'https://github.com/ensdomains',
xUrl: 'https://twitter.com/ensdomains',
homepageUrl: 'https://ens.domains/',
supportUrl: 'mailto:[email protected]',
Copy link
Collaborator

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?

Comment on lines -131 to -150
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,
}))
},
)

Copy link
Collaborator

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)

Copy link

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.

4 participants