Skip to content

Commit a89f766

Browse files
feat: Update wallet count from 350+ to 500+ and optimize SIWE linking (#5818)
1 parent 00af0ed commit a89f766

File tree

15 files changed

+99
-20
lines changed

15 files changed

+99
-20
lines changed

.changeset/shy-scissors-work.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+
Only connect wallets on SIWE linking if not already connected

apps/playground-web/src/app/connect/sign-in/button/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export default function Page(props: {
6565
description={
6666
<>
6767
A fully featured wallet connection component that allows to
68-
Connect to 350+ external wallets, connect via email, phone number,
68+
Connect to 500+ external wallets, connect via email, phone number,
6969
passkey or social logins, Convert any wallet to a ERC4337 smart
7070
wallet for gasless transactions and provides SIWE (Sign In With
7171
Ethereum)

apps/playground-web/src/app/connect/sign-in/components/WalletsSelection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export function WalletsSelection(props: {
6161
<div className="relative max-w-[320px] grow">
6262
<SearchIcon className="-translate-y-1/2 absolute top-1/2 left-3 size-4 text-muted-foreground" />
6363
<Input
64-
placeholder="Search from 350+ wallets"
64+
placeholder="Search from 500+ wallets"
6565
className="rounded-lg pl-9"
6666
value={search}
6767
onChange={(e) => setSearch(e.target.value)}

apps/playground-web/src/app/connect/sign-in/headless/page.tsx

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { HooksPreview } from "@/components/sign-in/hooks";
44
import ThirdwebProvider from "@/components/thirdweb-provider";
55
import { metadataBase } from "@/lib/constants";
66
import type { Metadata } from "next";
7+
import { ModalPreview } from "../../../../components/sign-in/modal";
78

89
export const metadata: Metadata = {
910
metadataBase,
@@ -28,13 +29,44 @@ export default function Page() {
2829
docsLink="https://portal.thirdweb.com/connect/sign-in/overview"
2930
heroLink="/connectors.png"
3031
/>
31-
32+
<Modal />
33+
<div className="h-6" />
3234
<Hooks />
3335
</main>
3436
</ThirdwebProvider>
3537
);
3638
}
3739

40+
function Modal() {
41+
return (
42+
<>
43+
<h2 className="mb-2 font-semibold text-2xl tracking-tight sm:text-3xl">
44+
Open the connect modal from anywhere
45+
</h2>
46+
47+
<p className="mb-5 max-w-[600px]">
48+
You can open the connect modal from anywhere in your app.
49+
</p>
50+
51+
<CodeExample
52+
preview={<ModalPreview />}
53+
code={`// Using your own UI
54+
import { useConnectModal } from "thirdweb/react";
55+
56+
function App(){
57+
const { connect } = useConnectModal();
58+
59+
return (
60+
// pass modal configuration options here
61+
<button onClick={() => connect({ client })}>Sign in</button>
62+
);
63+
};`}
64+
lang="tsx"
65+
/>
66+
</>
67+
);
68+
}
69+
3870
function Hooks() {
3971
return (
4072
<>
@@ -43,7 +75,7 @@ function Hooks() {
4375
</h2>
4476

4577
<p className="mb-5 max-w-[600px]">
46-
Build your own connect UI using react hooks.
78+
Full control over your UI using react hooks.
4779
<br />
4880
Wallet state management is all handled for you.
4981
</p>
@@ -57,14 +89,14 @@ function Hooks() {
5789
function App(){
5890
const { connect } = useConnect();
5991
60-
return (<>
92+
return (
6193
<button onClick={() => connect(async () => {
62-
// 350+ wallets supported with id autocomplete
94+
// 500+ wallets supported with id autocomplete
6395
const wallet = createWallet("io.metamask");
6496
await wallet.connect({ client });
6597
return wallet;
6698
})}>Connect with Metamask</button>
67-
</>);
99+
);
68100
};`}
69101
lang="tsx"
70102
/>

apps/playground-web/src/app/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function WalletsSection() {
2727
<ArticleCardIndex
2828
href="/connect/sign-in"
2929
title="Sign In"
30-
description="Integrate 350+ web3 wallets, in-app wallets, and smart accounts"
30+
description="Integrate 500+ web3 wallets, in-app wallets, and smart accounts"
3131
icon={WalletsConnectIcon}
3232
/>
3333
<ArticleCardIndex
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
"use client";
2+
3+
import {
4+
useActiveAccount,
5+
useActiveWallet,
6+
useConnectModal,
7+
useDisconnect,
8+
} from "thirdweb/react";
9+
import { shortenAddress } from "thirdweb/utils";
10+
import { THIRDWEB_CLIENT } from "../../lib/client";
11+
import { Button } from "../ui/button";
12+
13+
export function ModalPreview() {
14+
const account = useActiveAccount();
15+
const wallet = useActiveWallet();
16+
const connectMutation = useConnectModal();
17+
const { disconnect } = useDisconnect();
18+
19+
const connect = async () => {
20+
const wallet = await connectMutation.connect({ client: THIRDWEB_CLIENT });
21+
return wallet;
22+
};
23+
24+
return (
25+
<div className="flex flex-col">
26+
{account && wallet ? (
27+
<>
28+
<p className="py-4">Connected as {shortenAddress(account.address)}</p>
29+
<Button variant="outline" onClick={() => disconnect(wallet)}>
30+
Disconnect
31+
</Button>
32+
</>
33+
) : (
34+
<Button variant="default" onClick={connect}>
35+
Sign in
36+
</Button>
37+
)}
38+
</div>
39+
);
40+
}

packages/thirdweb/src/react/core/hooks/connection/ConnectButtonProps.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ export type ConnectButtonProps = {
592592
* ]
593593
* ```
594594
*
595-
* The `ConnectButton` also shows a "All wallets" button at the end of wallet list which allows user to connect to any of the 350+ wallets
595+
* The `ConnectButton` also shows a "All wallets" button at the end of wallet list which allows user to connect to any of the 500+ wallets
596596
*/
597597
wallets?: Wallet[];
598598

@@ -945,7 +945,7 @@ export type ConnectButtonProps = {
945945
recommendedWallets?: Wallet[];
946946

947947
/**
948-
* By default, ConnectButton modal shows a "All Wallets" button that shows a list of 350+ wallets.
948+
* By default, ConnectButton modal shows a "All Wallets" button that shows a list of 500+ wallets.
949949
*
950950
* You can disable this button by setting `showAllWallets` prop to `false`
951951
*/

packages/thirdweb/src/react/core/hooks/connection/ConnectEmbedProps.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export type ConnectEmbedProps = {
8787
* ]
8888
* ```
8989
*
90-
* The `ConnectEmbed` also shows a "All wallets" button at the end of wallet list which allows user to connect to any of the 350+ wallets
90+
* The `ConnectEmbed` also shows a "All wallets" button at the end of wallet list which allows user to connect to any of the 500+ wallets
9191
*/
9292
wallets?: Wallet[];
9393

@@ -266,7 +266,7 @@ export type ConnectEmbedProps = {
266266
recommendedWallets?: Wallet[];
267267

268268
/**
269-
* By default, `ConnectEmbed` shows a "All Wallets" button that shows a list of 350+ wallets.
269+
* By default, `ConnectEmbed` shows a "All Wallets" button that shows a list of 500+ wallets.
270270
*
271271
* You can disable this button by setting `showAllWallets` prop to `false`
272272
*/

packages/thirdweb/src/react/web/ui/ConnectWallet/ConnectButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const TW_CONNECT_WALLET = "tw-connect-wallet";
3636
/**
3737
* A fully featured wallet connection component that allows to:
3838
*
39-
* - Connect to 350+ external wallets
39+
* - Connect to 500+ external wallets
4040
* - Connect with email, phone, passkey or socials
4141
* - Convert any wallet to a ERC4337 smart wallet for gasless transactions
4242
* - Sign in with ethereum (Auth)

packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import { useSetupScreen } from "./screen.js";
4242
/**
4343
* An inline wallet connection component that allows to:
4444
*
45-
* - Connect to 350+ external wallets
45+
* - Connect to 500+ external wallets
4646
* - Connect with email, phone, passkey or socials
4747
* - Convert any wallet to a ERC4337 smart wallet for gasless transactions
4848
* - Sign in with ethereum (Auth)

0 commit comments

Comments
 (0)