From f62a4f85d58101600f9ec5ce9d2e3c93ee70f808 Mon Sep 17 00:00:00 2001 From: Manan Tank Date: Thu, 22 Feb 2024 00:35:46 +0530 Subject: [PATCH] Fix smartWallet selectUI --- .../wallets/smartWallet/smartWalletConfig.tsx | 52 ++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/packages/thirdweb/src/react/wallets/smartWallet/smartWalletConfig.tsx b/packages/thirdweb/src/react/wallets/smartWallet/smartWalletConfig.tsx index 82c17c87aa4..a560f7629e4 100644 --- a/packages/thirdweb/src/react/wallets/smartWallet/smartWalletConfig.tsx +++ b/packages/thirdweb/src/react/wallets/smartWallet/smartWalletConfig.tsx @@ -1,6 +1,8 @@ import { smartWallet } from "../../../wallets/smart/index.js"; import type { SmartWalletOptions } from "../../../wallets/smart/types.js"; -import type { WalletConfig } from "../../types/wallets.js"; +import { useThirdwebProviderProps } from "../../hooks/others/useThirdwebProviderProps.js"; +import type { SelectUIProps, WalletConfig } from "../../types/wallets.js"; +import { WalletEntryButton } from "../../ui/ConnectWallet/WalletSelector.js"; import { SmartConnectUI } from "./SmartWalletConnectUI.js"; export type SmartWalletConfigOptions = Omit< @@ -37,6 +39,7 @@ export const smartWalletConfig = ( }; const config: WalletConfig = { + category: walletConfig.category, metadata: metadata, create(createOptions) { return smartWallet({ @@ -45,6 +48,14 @@ export const smartWalletConfig = ( metadata, }); }, + selectUI: walletConfig.selectUI + ? (props) => ( + + ) + : undefined, connectUI(props) { return ( { + props.selectUIProps.selection.select(); + }} + /> + ); + } + + return ( + { + return personalWalletConfig.create({ + client, + dappMetadata, + }); + }, + done: () => {}, // ignore connection done in select UI + chain: props.selectUIProps.connection.chain, + chains: props.selectUIProps.connection.chains, + }} + selection={props.selectUIProps.selection} + /> + ); +}