11import  {  FeatureFlags ,  isEnabled  }  from  "@tallyho/tally-background/features" 
2- import  { 
3-   isProbablyEVMAddress , 
4-   truncateAddress , 
5- }  from  "@tallyho/tally-background/lib/utils" 
62import  {  NFTWithCollection  }  from  "@tallyho/tally-background/redux-slices/nfts_update" 
3+ import  {  getAccountNameOnChain  }  from  "@tallyho/tally-background/redux-slices/selectors" 
74import  React ,  {  ReactElement ,  useMemo  }  from  "react" 
85import  {  useTranslation  }  from  "react-i18next" 
9- import  {  useIntersectionObserver  }  from  "../../hooks" 
6+ import  {  useBackgroundSelector ,   useIntersectionObserver  }  from  "../../hooks" 
107import  {  trimWithEllipsis  }  from  "../../utils/textUtils" 
8+ import  SharedAddress  from  "../Shared/SharedAddress" 
119import  SharedButton  from  "../Shared/SharedButton" 
1210import  SharedNetworkIcon  from  "../Shared/SharedNetworkIcon" 
1311import  ExploreMarketLink ,  {  getRelevantMarketsList  }  from  "./ExploreMarketLink" 
@@ -38,6 +36,7 @@ export default function NFTPreview(props: NFTWithCollection): ReactElement {
3836    owner, 
3937    description, 
4038    attributes, 
39+     supply, 
4140    isBadge, 
4241  }  =  nft 
4342  const  {  totalNftCount }  =  collection 
@@ -46,6 +45,10 @@ export default function NFTPreview(props: NFTWithCollection): ReactElement {
4645    collection . floorPrice ?. value  !==  undefined  && 
4746    collection . floorPrice 
4847
48+   const  ownerName  =  useBackgroundSelector ( ( state )  => 
49+     getAccountNameOnChain ( state ,  {  address : owner ,  network } ) 
50+   ) 
51+ 
4952  // Chrome seems to have problems when elements with backdrop style are rendered initially 
5053  // out of the viewport - browser is not rendering them at all. This is a workaround 
5154  // to force them to rerender. 
@@ -87,10 +90,10 @@ export default function NFTPreview(props: NFTWithCollection): ReactElement {
8790                { t ( "preview.owner" ) } 
8891              </ span > 
8992              < span  className = "preview_details_value" > 
90-                 { truncateAddress ( owner ) } 
93+                 < SharedAddress   address = { owner }   name = { ownerName }   elide   /> 
9194              </ span > 
9295            </ div > 
93-             < div  className = "preview_section_column align_right" > 
96+             < div  className = "preview_section_column align_right no_shrink " > 
9497              < span  className = "preview_details_header" > 
9598                { t ( "preview.floorPrice" ) } 
9699              </ span > 
@@ -153,13 +156,15 @@ export default function NFTPreview(props: NFTWithCollection): ReactElement {
153156            < div  className = "preview_section_header" > 
154157              { t ( "preview.itemsCount" ) } 
155158            </ div > 
156-             < p > { totalNftCount  ??  "-" } </ p > 
159+             < p > { totalNftCount  ??  supply   ??   "-" } </ p > 
157160          </ div > 
158161          < div  className = "preview_section_column align_right" > 
159162            < div  className = "preview_section_header" > { t ( "preview.creator" ) } </ div > 
160-             < p > 
161-               { isProbablyEVMAddress ( contract )  ? truncateAddress ( contract )  : "-" } 
162-             </ p > 
163+             { contract ?. length  ? ( 
164+               < SharedAddress  address = { contract }  elide  /> 
165+             )  : ( 
166+               "-" 
167+             ) } 
163168          </ div > 
164169        </ div > 
165170
@@ -261,6 +266,7 @@ export default function NFTPreview(props: NFTWithCollection): ReactElement {
261266        .preview_section_column { 
262267          display: flex; 
263268          flex-direction: column; 
269+           min-width: 0; 
264270        } 
265271        .preview_section_row { 
266272          display: flex; 
@@ -309,6 +315,9 @@ export default function NFTPreview(props: NFTWithCollection): ReactElement {
309315          gap: 16px; 
310316          justify-content: flex-start; 
311317        } 
318+         .no_shrink { 
319+           flex-shrink: 0; 
320+         } 
312321      ` } </ style > 
313322    </ > 
314323  ) 
0 commit comments