From dbb261430654b0ffb1c47d4b52e86aabe19fe2ab Mon Sep 17 00:00:00 2001 From: MananTank Date: Wed, 3 Sep 2025 17:43:59 +0000 Subject: [PATCH] [BLD-228] SDK/React: Do not exclude specified wallets from all wallets list in Connect UI (#7974) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ## PR-Codex overview This PR focuses on removing the `specifiedWallets` prop from various components related to wallet selection in the `thirdweb` package, streamlining the wallet filtering logic. ### Detailed summary - Removed `specifiedWallets` prop from the `WalletAuth` component. - Updated `ConnectModalContent` to remove `specifiedWallets` and utilize `recommendedWallets`. - Modified `AllWalletsUI` to eliminate `specifiedWallets` and simplify wallet filtering logic. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` ## Summary by CodeRabbit - Refactor - Simplified the wallet selection list to a standardized set across the Connect modal and in-app auth. - Removed custom list filtering, ensuring a consistent experience regardless of entry point. - The list now excludes in-app, embedded, and smart wallets from the “All Wallets” view. --- .../web/ui/ConnectWallet/Modal/AllWalletsUI.tsx | 17 +++++------------ .../ConnectWallet/Modal/ConnectModalContent.tsx | 1 - .../src/react/web/wallets/in-app/WalletAuth.tsx | 1 - 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/AllWalletsUI.tsx b/packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/AllWalletsUI.tsx index c8a32924ea5..cf4fe2c8658 100644 --- a/packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/AllWalletsUI.tsx +++ b/packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/AllWalletsUI.tsx @@ -28,7 +28,6 @@ import { WalletEntryButton } from "../WalletEntryButton.js"; function AllWalletsUI(props: { onBack: () => void; onSelect: (wallet: Wallet) => void; - specifiedWallets: Wallet[]; size: "compact" | "wide"; client: ThirdwebClient; recommendedWallets: Wallet[] | undefined; @@ -39,17 +38,11 @@ function AllWalletsUI(props: { const setSelectionData = useSetSelectionData(); const walletList = useMemo(() => { - return walletInfos - .filter((wallet) => { - return ( - props.specifiedWallets.findIndex((x) => x.id === wallet.id) === -1 - ); - }) - .filter( - (info) => - info.id !== "inApp" && info.id !== "embedded" && info.id !== "smart", - ); - }, [props.specifiedWallets]); + return walletInfos.filter( + (info) => + info.id !== "inApp" && info.id !== "embedded" && info.id !== "smart", + ); + }, []); const fuseInstance = useMemo(() => { return new Fuse(walletList, { diff --git a/packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectModalContent.tsx b/packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectModalContent.tsx index 7f41018a344..2ea71c6ab7d 100644 --- a/packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectModalContent.tsx +++ b/packages/thirdweb/src/react/web/ui/ConnectWallet/Modal/ConnectModalContent.tsx @@ -173,7 +173,6 @@ export const ConnectModalContent = (props: { onSelect={setScreen} recommendedWallets={props.recommendedWallets} size={props.size} - specifiedWallets={props.wallets} /> ); diff --git a/packages/thirdweb/src/react/web/wallets/in-app/WalletAuth.tsx b/packages/thirdweb/src/react/web/wallets/in-app/WalletAuth.tsx index 408136edbd8..14988b28b97 100644 --- a/packages/thirdweb/src/react/web/wallets/in-app/WalletAuth.tsx +++ b/packages/thirdweb/src/react/web/wallets/in-app/WalletAuth.tsx @@ -104,7 +104,6 @@ export function WalletAuth(props: { }} recommendedWallets={undefined} size={props.size} - specifiedWallets={[]} /> );