Skip to content

Commit

Permalink
fix notes tag on token page
Browse files Browse the repository at this point in the history
  • Loading branch information
tom2drum committed Nov 7, 2024
1 parent 9d083de commit 151dfef
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions ui/token/TokenPageTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import type { ResourceError } from 'lib/api/resources';
import useApiQuery from 'lib/api/useApiQuery';
import { useAppContext } from 'lib/contexts/app';
import { getTokenTypeName } from 'lib/token/tokenTypes';
import AddressMetadataAlert from 'ui/address/details/AddressMetadataAlert';
import AddressQrCode from 'ui/address/details/AddressQrCode';
import AccountActionsMenu from 'ui/shared/AccountActionsMenu/AccountActionsMenu';
import AddressAddToWallet from 'ui/shared/address/AddressAddToWallet';
Expand Down Expand Up @@ -82,7 +83,7 @@ const TokenPageTitle = ({ tokenQuery, addressQuery, hash }: Props) => {
verifiedInfoQuery.data?.projectSector ?
{ slug: verifiedInfoQuery.data.projectSector, name: verifiedInfoQuery.data.projectSector, tagType: 'custom' as const, ordinal: -30 } :
undefined,
...(addressMetadataQuery.data?.addresses?.[hash.toLowerCase()]?.tags || []),
...(addressMetadataQuery.data?.addresses?.[hash.toLowerCase()]?.tags.filter(tag => tag.tagType !== 'note') || []),
].filter(Boolean).sort(sortEntityTags);
}, [
addressMetadataQuery.data?.addresses,
Expand Down Expand Up @@ -133,20 +134,24 @@ const TokenPageTitle = ({ tokenQuery, addressQuery, hash }: Props) => {
);

return (
<PageTitle
title={ `${ tokenQuery.data?.name || 'Unnamed token' }${ tokenSymbolText }` }
isLoading={ tokenQuery.isPlaceholderData }
backLink={ backLink }
beforeTitle={ tokenQuery.data ? (
<TokenEntity.Icon
token={ tokenQuery.data }
isLoading={ tokenQuery.isPlaceholderData }
size="lg"
/>
) : null }
contentAfter={ contentAfter }
secondRow={ secondRow }
/>
<>
<PageTitle
title={ `${ tokenQuery.data?.name || 'Unnamed token' }${ tokenSymbolText }` }
isLoading={ tokenQuery.isPlaceholderData }
backLink={ backLink }
beforeTitle={ tokenQuery.data ? (
<TokenEntity.Icon
token={ tokenQuery.data }
isLoading={ tokenQuery.isPlaceholderData }
size="lg"
/>
) : null }
contentAfter={ contentAfter }
secondRow={ secondRow }
/>
{ !addressMetadataQuery.isPending &&
<AddressMetadataAlert tags={ addressMetadataQuery.data?.addresses?.[hash.toLowerCase()]?.tags } mt="-4px" mb={ 6 }/> }
</>
);
};

Expand Down

0 comments on commit 151dfef

Please sign in to comment.