From 64fc075f7a94c0a6f386edde1b50553477ad513a Mon Sep 17 00:00:00 2001 From: "m.ray" <16125548+MadalinaRaicu@users.noreply.github.com> Date: Wed, 27 Mar 2024 10:11:37 +0000 Subject: [PATCH] fix(trading): do not show alias edit on read only (#6111) --- .../vega-wallet-connect-button.tsx | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 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 259dd42b4..69ce6f387 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 @@ -96,6 +96,7 @@ export const VegaWalletConnectButton = ({ pubKeys={pubKeys} activeKey={activeKey?.publicKey} onSelect={selectPubKey} + isReadOnly={isReadOnly} /> {!isReadOnly && ( @@ -141,11 +142,13 @@ const KeypairRadioGroup = ({ pubKeys, activeKey, onSelect, + isReadOnly, }: { pubKey: string | undefined; pubKeys: Key[]; activeKey: string | undefined; onSelect: (pubKey: string) => void; + isReadOnly: boolean; }) => { const { data } = usePartyProfilesQuery({ variables: { partyIds: pubKeys.map((pk) => pk.publicKey) }, @@ -165,6 +168,7 @@ const KeypairRadioGroup = ({ pk={pk} isActive={activeKey === pk.publicKey} alias={profile?.node.alias} + isReadOnly={isReadOnly} /> ); })} @@ -176,10 +180,12 @@ const KeypairItem = ({ pk, isActive, alias, + isReadOnly, }: { pk: Key; alias: string | undefined; isActive: boolean; + isReadOnly: boolean; }) => { const t = useT(); const [copied, setCopied] = useCopyTimeout(); @@ -210,16 +216,18 @@ const KeypairItem = ({ className={classNames('flex-1 mr-2 text-secondary text-sm')} data-testid={`key-${pk.publicKey}`} > - - - + {!isReadOnly && ( + + + + )}