From d5f89fc0adc092df699b282cde4be863abed540e Mon Sep 17 00:00:00 2001 From: Kristof Csillag Date: Tue, 14 Jan 2025 03:45:48 +0100 Subject: [PATCH] Rename prop for clarity --- .changelog/1687.bugfix.md | 1 + src/app/components/Account/AccountLink.tsx | 11 ++++++++--- .../components/Account/RuntimeAccountDetailsView.tsx | 2 +- src/app/components/Tokens/TokenDetails.tsx | 2 +- src/app/components/Tokens/TokenList.tsx | 2 +- src/app/pages/TokenDashboardPage/TokenDetailsCard.tsx | 6 +----- 6 files changed, 13 insertions(+), 11 deletions(-) create mode 100644 .changelog/1687.bugfix.md diff --git a/.changelog/1687.bugfix.md b/.changelog/1687.bugfix.md new file mode 100644 index 0000000000..2ab2681476 --- /dev/null +++ b/.changelog/1687.bugfix.md @@ -0,0 +1 @@ +Fix a small regression in displaying account names diff --git a/src/app/components/Account/AccountLink.tsx b/src/app/components/Account/AccountLink.tsx index 58196c56cd..a613d72952 100644 --- a/src/app/components/Account/AccountLink.tsx +++ b/src/app/components/Account/AccountLink.tsx @@ -45,7 +45,12 @@ const WithTypographyAndLink: FC<{ } interface Props { - showAddressAsName?: boolean + /** + * Should only show the address, never a name + * + * (Use this in situations when the name is already on the screen for some reason.) + */ + showOnlyAddress?: boolean scope: SearchScope address: string @@ -80,7 +85,7 @@ interface Props { } export const AccountLink: FC = ({ - showAddressAsName, + showOnlyAddress, scope, address, alwaysTrim, @@ -95,7 +100,7 @@ export const AccountLink: FC = ({ // isError, // Use this to indicate that we have failed to load the name for this account } = useAccountMetadata(scope, address) const accountName = accountMetadata?.name // TODO: we should also use the description - const showAccountName = !showAddressAsName && accountName + const showAccountName = !showOnlyAddress && !!accountName const to = RouteUtils.getAccountRoute(scope, address) const extraTooltipWithIcon = extraTooltip ? ( diff --git a/src/app/components/Account/RuntimeAccountDetailsView.tsx b/src/app/components/Account/RuntimeAccountDetailsView.tsx index db6aede1dc..919f916396 100644 --- a/src/app/components/Account/RuntimeAccountDetailsView.tsx +++ b/src/app/components/Account/RuntimeAccountDetailsView.tsx @@ -77,7 +77,7 @@ export const RuntimeAccountDetailsView: FC = ({
diff --git a/src/app/components/Tokens/TokenList.tsx b/src/app/components/Tokens/TokenList.tsx index 041f09e989..fedb351494 100644 --- a/src/app/components/Tokens/TokenList.tsx +++ b/src/app/components/Tokens/TokenList.tsx @@ -108,7 +108,7 @@ export const TokenList = (props: TokensProps) => { content: ( {t(isMobile ? 'common.smartContract_short' : 'common.smartContract')}
- +