From 101ae00a57dd9130f292de3b27917864516ef8b5 Mon Sep 17 00:00:00 2001
From: "m.ray" <16125548+MadalinaRaicu@users.noreply.github.com>
Date: Tue, 14 Mar 2023 10:39:47 -0400
Subject: [PATCH] fix(trading): hide transfer button in view as mode (#3189)
---
.../vega-wallet-connect-button.tsx | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/apps/trading/components/vega-wallet-connect-button/vega-wallet-connect-button.tsx b/apps/trading/components/vega-wallet-connect-button/vega-wallet-connect-button.tsx
index 342c55c86..54ad5c36e 100644
--- a/apps/trading/components/vega-wallet-connect-button/vega-wallet-connect-button.tsx
+++ b/apps/trading/components/vega-wallet-connect-button/vega-wallet-connect-button.tsx
@@ -145,7 +145,8 @@ export const VegaWalletConnectButton = () => {
(store) => store.openVegaWalletDialog
);
const openTransferDialog = useTransferDialog((store) => store.open);
- const { pubKey, pubKeys, selectPubKey, disconnect } = useVegaWallet();
+ const { pubKey, pubKeys, selectPubKey, disconnect, isReadOnly } =
+ useVegaWallet();
const isConnected = pubKey !== null;
const activeKey = useMemo(() => {
@@ -186,12 +187,14 @@ export const VegaWalletConnectButton = () => {
))}
- openTransferDialog(true)}
- >
- {t('Transfer')}
-
+ {!isReadOnly && (
+ openTransferDialog(true)}
+ >
+ {t('Transfer')}
+
+ )}
{t('Disconnect')}