From 7358c83e2300b9b8ce3636bbdb570c2900a94dd4 Mon Sep 17 00:00:00 2001 From: sam-keen Date: Fri, 12 May 2023 12:02:50 +0100 Subject: [PATCH] fix(3576): useWeb3ConnectStore instead of app state for eth connect dialog --- .../eth-connect-prompt/eth-connect-promp.tsx | 15 +++------------ .../eth-wallet-container.tsx | 18 +++--------------- .../src/components/eth-wallet/eth-wallet.tsx | 14 +++++++------- .../web3-connector/web3-connector.tsx | 14 ++++++++++---- .../contexts/app-state/app-state-context.ts | 8 -------- .../contexts/app-state/app-state-provider.tsx | 7 ------- .../components/list-asset/list-asset.spec.tsx | 1 - .../hooks/use-vote-information.spec.ts | 1 - 8 files changed, 23 insertions(+), 55 deletions(-) diff --git a/apps/governance/src/components/eth-connect-prompt/eth-connect-promp.tsx b/apps/governance/src/components/eth-connect-prompt/eth-connect-promp.tsx index 9ddcb2e8e..c4cc7cde8 100644 --- a/apps/governance/src/components/eth-connect-prompt/eth-connect-promp.tsx +++ b/apps/governance/src/components/eth-connect-prompt/eth-connect-promp.tsx @@ -1,23 +1,14 @@ import { Button } from '@vegaprotocol/ui-toolkit'; import { useTranslation } from 'react-i18next'; - -import { - AppStateActionType, - useAppState, -} from '../../contexts/app-state/app-state-context'; +import { useWeb3ConnectStore } from '@vegaprotocol/web3'; export const EthConnectPrompt = () => { const { t } = useTranslation(); - const { appDispatch } = useAppState(); + const { open } = useWeb3ConnectStore(); return ( + ); } diff --git a/apps/governance/src/components/eth-wallet/eth-wallet.tsx b/apps/governance/src/components/eth-wallet/eth-wallet.tsx index ca334a43d..4890abccf 100644 --- a/apps/governance/src/components/eth-wallet/eth-wallet.tsx +++ b/apps/governance/src/components/eth-wallet/eth-wallet.tsx @@ -27,7 +27,11 @@ import { import { Loader } from '@vegaprotocol/ui-toolkit'; import colors from 'tailwindcss/colors'; import { useBalances } from '../../lib/balances/balances-store'; -import { useEthereumConfig, useWeb3Disconnect } from '@vegaprotocol/web3'; +import { + useEthereumConfig, + useWeb3ConnectStore, + useWeb3Disconnect, +} from '@vegaprotocol/web3'; import { getChainName } from '@vegaprotocol/web3'; const removeLeadingAddressSymbol = (key: string) => { @@ -189,6 +193,7 @@ export const EthWallet = () => { const pendingTxs = usePendingTransactions(); const disconnect = useWeb3Disconnect(connector); const { config } = useEthereumConfig(); + const { open } = useWeb3ConnectStore(); return ( @@ -233,12 +238,7 @@ export const EthWallet = () => { ) : (