From 4f447468ccad2e360ed5fb30431934659a86b26b Mon Sep 17 00:00:00 2001 From: Hugo Lextrait Date: Wed, 19 Mar 2025 15:44:38 +0100 Subject: [PATCH 1/2] feat: enhance WalletButton with connected chain display and button size adjustments --- src/components/dapp/WalletButton.tsx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/components/dapp/WalletButton.tsx b/src/components/dapp/WalletButton.tsx index 377b1c1a4..e6e343d24 100644 --- a/src/components/dapp/WalletButton.tsx +++ b/src/components/dapp/WalletButton.tsx @@ -55,6 +55,11 @@ export default function WalletButton({ select, connect, status, hideSpyMode = fa ); }, [chains]); + const connectedChain = useMemo(() => { + if (!chainId) return null; + return chains.find(chain => chain.id === chainId); + }, [chainId, chains]); + if (!connected) return ( }> {connect || ( - )} @@ -71,9 +76,6 @@ export default function WalletButton({ select, connect, status, hideSpyMode = fa return ( <> - {select || ( -