diff --git a/lib/shortenUniversalProfile.ts b/lib/shortenUniversalProfile.ts index 224dfbccc7..2331a2c737 100644 --- a/lib/shortenUniversalProfile.ts +++ b/lib/shortenUniversalProfile.ts @@ -7,8 +7,8 @@ export default function shortenUniversalProfile(string: string | null) { return string; } - const upParts = string.split('#'); - const hashHead = '#' + upParts[1].slice(2, 6); // change #0x1234 -> #1234 + const upParts = string.split(' ('); + const hashHead = '#' + upParts[1].slice(2, 6); // change (0x1234) -> #1234 - return string.slice(0, 3) + '...' + hashHead; + return string.slice(0, 2) + '...' + hashHead; } diff --git a/ui/shared/HashStringShorten.tsx b/ui/shared/HashStringShorten.tsx index 11c08630df..2ec0727c8a 100644 --- a/ui/shared/HashStringShorten.tsx +++ b/ui/shared/HashStringShorten.tsx @@ -20,7 +20,7 @@ const HashStringShorten = ({ hash, isTooltipDisabled, as = 'span' }: Props) => { if (identiconType === undefined) { return undefined; } - if (identiconType.includes('universal_profile') && hash.includes('#')) { + if (identiconType.includes('universal_profile') && hash.includes(' (')) { setShortenedString(shortenUniversalProfile(hash)); } }, [ hash ]); diff --git a/ui/shared/HashStringShortenDynamic.tsx b/ui/shared/HashStringShortenDynamic.tsx index 8cbf5753fa..f916290b39 100644 --- a/ui/shared/HashStringShortenDynamic.tsx +++ b/ui/shared/HashStringShortenDynamic.tsx @@ -73,12 +73,12 @@ const HashStringShortenDynamic = ({ hash, fontWeight = '400', isTooltipDisabled, if (identiconType === undefined) { return; } - if (identiconType.includes('universal_profile') && hash.includes('#')) { - const upParts = hash.split('#'); - const hashHead = '#' + upParts[1].slice(2, 6); // change #0x1234 -> #1234 + if (identiconType.includes('universal_profile') && hash.includes(' (')) { + const upParts = hash.split(' ('); + const hashHead = '#' + upParts[1].slice(2, 6); // change (0x1234...5678) -> #1234 const name = upParts[0]; - const slicedName = name.slice(0, rightI - 2); - const displayed = rightI - 2 > name.length ? name + hashHead : slicedName + '...' + hashHead; + const slicedName = name.slice(0, rightI - 3); + const displayed = rightI - 3 > name.length ? name + hashHead : slicedName + '...' + hashHead; setDisplayedString(displayed); return; diff --git a/ui/shared/entities/address/IdenticonUniversalProfileQuery.tsx b/ui/shared/entities/address/IdenticonUniversalProfileQuery.tsx index e751104bd4..0625be1d54 100644 --- a/ui/shared/entities/address/IdenticonUniversalProfileQuery.tsx +++ b/ui/shared/entities/address/IdenticonUniversalProfileQuery.tsx @@ -13,7 +13,7 @@ interface Props { } export const formattedLuksoName = (hash: string, name: string) => { - return `@${ name }#${ hash }`; + return `@${ name } (${ hash })`; }; export const getUniversalProfile = async(address: string, queryClient: QueryClient) => {