Commit 79b02e11 authored by tom goriunov's avatar tom goriunov Committed by GitHub

Adjust NFT token title (#1797)

Fixes #1790
parent f95bb0f8
...@@ -174,20 +174,34 @@ const TokenInstanceContent = () => { ...@@ -174,20 +174,34 @@ const TokenInstanceContent = () => {
pagination = holdersQuery.pagination; pagination = holdersQuery.pagination;
} }
const title = (() => {
if (typeof tokenInstanceQuery.data?.metadata?.name === 'string') {
return tokenInstanceQuery.data.metadata.name;
}
if (tokenQuery.data?.symbol) {
return (tokenQuery.data.name || tokenQuery.data.symbol) + ' #' + tokenInstanceQuery.data?.id;
}
return `ID ${ tokenInstanceQuery.data?.id }`;
})();
const titleSecondRow = ( const titleSecondRow = (
<Flex alignItems="center" w="100%" minW={ 0 } columnGap={ 2 } rowGap={ 2 } flexWrap={{ base: 'wrap', lg: 'nowrap' }}> <Flex alignItems="center" w="100%" minW={ 0 } columnGap={ 2 } rowGap={ 2 } flexWrap={{ base: 'wrap', lg: 'nowrap' }}>
<TokenEntity { tokenQuery.data && (
token={ tokenQuery.data } <TokenEntity
isLoading={ isLoading } token={ tokenQuery.data }
noSymbol isLoading={ isLoading }
noCopy noSymbol
jointSymbol noCopy
fontFamily="heading" jointSymbol
fontSize="lg" fontFamily="heading"
fontWeight={ 500 } fontSize="lg"
w="auto" fontWeight={ 500 }
maxW="700px" w="auto"
/> maxW="700px"
/>
) }
{ !isLoading && tokenInstanceQuery.data && <AddressAddToWallet token={ tokenQuery.data } variant="button"/> } { !isLoading && tokenInstanceQuery.data && <AddressAddToWallet token={ tokenQuery.data } variant="button"/> }
<AddressQrCode address={ address } isLoading={ isLoading }/> <AddressQrCode address={ address } isLoading={ isLoading }/>
<AccountActionsMenu isLoading={ isLoading }/> <AccountActionsMenu isLoading={ isLoading }/>
...@@ -199,7 +213,7 @@ const TokenInstanceContent = () => { ...@@ -199,7 +213,7 @@ const TokenInstanceContent = () => {
<> <>
<TextAd mb={ 6 }/> <TextAd mb={ 6 }/>
<PageTitle <PageTitle
title={ `ID ${ tokenInstanceQuery.data?.id }` } title={ title }
backLink={ backLink } backLink={ backLink }
contentAfter={ tokenTag } contentAfter={ tokenTag }
secondRow={ titleSecondRow } secondRow={ titleSecondRow }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment