@@ -11,49 +11,56 @@ interface NFTCardProps {
1111}
1212
1313export const NFTCard = ( props : NFTCardProps ) => {
14- const { nftCollectionAdress, tokenIds } = props ;
15- const nftData = useNFTInfoQuery ( nftCollectionAdress , tokenIds ) ;
16- const nftObject = nftData . data as any ;
17- return (
18- < >
19- { nftData . data &&
20- tokenIds . map ( ( index ) => {
21- if ( nftObject [ index ] . data ) {
22- const nftCollectionInfo = nftObject [ index ] [ 'data' ] [ 'tokensPage' ] [ 'collection' ] [ 'collectionInfo' ] ;
23- const nft = nftObject [ index ] [ 'data' ] [ 'tokensPage' ] [ 'token' ] ;
24- return (
25- < Container className = { styles . card } >
26- < img src = { nft . imageUrlFileserver } width = { 156 } className = { styles . nftPreview } alt = "NFT Preview" />
27- < Container direction = "column" className = { styles . nftInfo } gap = { 16 } >
28- < Text className = { styles . name } variant = "label" >
29- { nft . name }
30- </ Text >
31- { nft . price ? (
32- < Text className = { styles . price } variant = "label" >
33- { nft . denom }
34- { formatAmount ( demicrofy ( nft . price , 6 ) ) } { ' ' }
35- </ Text >
36- ) : (
37- < Text className = { styles . price } variant = "label" >
38- { nftCollectionInfo . floor_price && formatAmount ( demicrofy ( nftCollectionInfo . floor_price , 6 ) ) } { ' ' }
39- </ Text >
40- ) }
41- </ Container >
42- </ Container >
43- ) ;
44- } else {
45- return (
46- < Container className = { styles . card } >
47- < img src = { nftObject [ index ] . image_data } width = { 156 } className = { styles . nftPreview } alt = "NFT Preview" />
48- < Container direction = "column" className = { styles . nftInfo } gap = { 16 } >
49- < Text className = { styles . name } variant = "label" >
50- { nftObject [ index ] . name }
51- </ Text >
52- </ Container >
53- </ Container >
54- ) ;
55- }
56- } ) }
57- </ >
58- ) ;
14+ const { nftCollectionAdress, tokenIds } = props ;
15+ const nftData = useNFTInfoQuery ( nftCollectionAdress , tokenIds ) ;
16+ const nftObject = nftData . data as any ;
17+ return (
18+ < >
19+ { nftData . data && (
20+ tokenIds . map ( ( index ) => {
21+ if ( nftObject [ index ] . data ) {
22+ const nftCollectionInfo = nftObject [ index ] [ "data" ] [ "tokensPage" ] [ "collection" ] [ "collectionInfo" ]
23+ const nft = nftObject [ index ] [ 'data' ] [ 'tokensPage' ] [ 'token' ] ;
24+
25+
26+ return (
27+ < Container className = { styles . card } >
28+ < img src = { nft . imageUrlFileserver } width = { 156 } className = { styles . nftPreview } alt = "NFT Preview" />
29+ < Container direction = "column" className = { styles . nftInfo } gap = { 16 } >
30+ < Text className = { styles . name } variant = "label" >
31+ { nft . name }
32+ </ Text >
33+ { nft . price ? (
34+ < Text className = { styles . price } variant = "label" >
35+ { nft . denom }
36+ { formatAmount ( demicrofy ( nft . price , 6 ) ) } { ' ' }
37+ </ Text >
38+ ) : (
39+ < Text className = { styles . price } variant = "label" >
40+ { nftCollectionInfo . floor_price && formatAmount ( demicrofy ( nftCollectionInfo . floor_price , 6 ) ) } { ' ' }
41+ </ Text >
42+ ) }
43+ </ Container >
44+ </ Container >
45+ ) ;
46+ } else {
47+ return (
48+ < Container className = { styles . card } >
49+ < img src = { nftObject [ index ] . image } width = { 156 } className = { styles . nftPreview } alt = "NFT Preview" />
50+ < Container direction = "column" className = { styles . nftInfo } gap = { 16 } >
51+ < Text className = { styles . name } variant = "label" >
52+ { nftObject [ index ] . name }
53+ </ Text >
54+ < Text className = { styles . price } variant = "label" >
55+ </ Text >
56+ </ Container >
57+ </ Container >
58+ )
59+ }
60+ } )
61+ ) }
62+
63+
64+ </ >
65+ ) ;
5966} ;
0 commit comments