From be3ba449691edf00a9096ad59f21fdd5ca73c2be Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Fri, 13 Oct 2023 11:55:36 +0200 Subject: [PATCH] Show edit name icon only when url match selected wallet --- .../AccountPage/Features/AccountSummary/index.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/pages/AccountPage/Features/AccountSummary/index.tsx b/src/app/pages/AccountPage/Features/AccountSummary/index.tsx index 1ef163ce1d..52c554326e 100644 --- a/src/app/pages/AccountPage/Features/AccountSummary/index.tsx +++ b/src/app/pages/AccountPage/Features/AccountSummary/index.tsx @@ -99,7 +99,7 @@ export function AccountSummary({ address, balance, wallet, walletHasAccounts }: const isMobile = useContext(ResponsiveContext) === 'small' const ticker = useSelector(selectTicker) const unlockedStatus = useSelector(selectUnlockedStatus) - const unlockedProfile = unlockedStatus === 'unlockedProfile' + const canEditName = unlockedStatus === 'unlockedProfile' && address === wallet?.address const editHandler = (name: string) => { if (!wallet) { throw new Error('Wallet not provided') @@ -136,11 +136,11 @@ export function AccountSummary({ address, balance, wallet, walletHasAccounts }: > - {!unlockedProfile && } - {unlockedProfile && !wallet?.name && ( + {!canEditName && } + {canEditName && !wallet?.name && ( setLayerVisibility(true)} /> )} - {unlockedProfile && wallet?.name && ( + {canEditName && wallet?.name && ( setLayerVisibility(true)} @@ -181,7 +181,7 @@ export function AccountSummary({ address, balance, wallet, walletHasAccounts }: )} - {layerVisibility && wallet && unlockedProfile && ( + {layerVisibility && wallet && canEditName && ( setLayerVisibility(false)}