Skip to content

Commit cb98fa8

Browse files
0xFirekeeperclaude
andauthored
[SDK] Render the WalletConnect QR in the connect modal (#8995)
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 6214925 commit cb98fa8

2 files changed

Lines changed: 29 additions & 2 deletions

File tree

‎.changeset/fallback-inmodal-qr.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Show the WalletConnect QR inside the connect modal instead of a separate window

‎packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.tsx‎

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import type {
99
InjectedSupportedWalletIds,
1010
WCSupportedWalletIds,
1111
} from "../../../../../wallets/__generated__/wallet-ids.js";
12+
import { BASE_ACCOUNT, COINBASE } from "../../../../../wallets/constants.js";
1213
import { isEcosystemWallet } from "../../../../../wallets/ecosystem/is-ecosystem-wallet.js";
1314
import { getInstalledWalletProviders } from "../../../../../wallets/injected/mipdStore.js";
1415
import type { Wallet } from "../../../../../wallets/interfaces/wallet.js";
@@ -274,8 +275,8 @@ export function AnyWalletConnectUI(props: {
274275
);
275276
}
276277

277-
// any other known wallet
278-
if (props.wallet.id) {
278+
// wallets with their own SDK
279+
if (props.wallet.id === COINBASE || props.wallet.id === BASE_ACCOUNT) {
279280
return (
280281
<Suspense fallback={<LoadingScreen />}>
281282
<CoinbaseSDKWalletConnectUI
@@ -295,6 +296,27 @@ export function AnyWalletConnectUI(props: {
295296
);
296297
}
297298

299+
// any other known wallet connects over WalletConnect, which renders its QR in the modal
300+
if (props.wallet.id) {
301+
return (
302+
<WalletConnectConnection
303+
chain={props.chain}
304+
chains={props.chains}
305+
client={props.client}
306+
done={props.done}
307+
locale={locale}
308+
onBack={props.onBack}
309+
onGetStarted={() => {
310+
setScreen("get-started");
311+
}}
312+
size={props.size}
313+
wallet={props.wallet as Wallet<WCSupportedWalletIds>}
314+
walletConnect={props.walletConnect}
315+
walletInfo={walletInfo.data}
316+
/>
317+
);
318+
}
319+
298320
// if can't connect in any way - show get started screen
299321
return (
300322
<GetStartedScreen

0 commit comments

Comments
 (0)