fix(trading): hide transfer button in view as mode (#3189)

This commit is contained in:
m.ray 2023-03-14 10:39:47 -04:00 committed by GitHub
parent 613cce3683
commit 101ae00a57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 = () => {
))}
</DropdownMenuRadioGroup>
<DropdownMenuSeparator />
{!isReadOnly && (
<DropdownMenuItem
data-testid="wallet-transfer"
onClick={() => openTransferDialog(true)}
>
{t('Transfer')}
</DropdownMenuItem>
)}
<DropdownMenuItem data-testid="disconnect" onClick={disconnect}>
{t('Disconnect')}
</DropdownMenuItem>