@@ -13,6 +13,7 @@ import { GetUserMetadata } from '../../data/api'
1313import { ResponsiveMasonry } from '../../components/responsive-masonry'
1414import InfiniteScroll from 'react-infinite-scroll-component'
1515import styles from './styles.module.scss'
16+ import { NFTStorage } from 'nft.storage'
1617
1718const axios = require ( 'axios' )
1819const fetch = require ( 'node-fetch' )
@@ -563,6 +564,10 @@ export default class Display extends Component {
563564 this . context . batch_cancel ( this . state . marketV1 . slice ( 0 , 10 ) )
564565 }
565566
567+ collect = ( event ) => {
568+ alert ( 'hello' )
569+ }
570+
566571 getDiscordTooltip ( ) {
567572 const handleSize = this . state . discord . length ;
568573 const missingSize = handleSize - 6 ;
@@ -924,34 +929,41 @@ export default class Display extends Component {
924929 >
925930 < ResponsiveMasonry >
926931 { this . state . items . map ( ( nft ) => {
927- console . log ( nft )
932+ // console.log('swappssss ' + JSON.stringify(nft))
933+ // console.log(nft.swaps.length > 0 ? 'nft asdfadf: ' + JSON.stringify(nft.swaps[0].price) : 'asdf')
928934 return (
929- < Button
930- style = { { positon : 'relative' } }
931- key = { nft . id }
932- to = { `${ PATH . OBJKT } /${ nft . id } ` } >
933- < div className = { styles . card } >
934- < div className = { styles . cardText } >
935- < div > #{ nft . id } </ div >
936- < div > { nft . title } </ div >
935+ < div className = { styles . cardContainer } >
936+ < Button
937+ style = { { positon : 'relative' } }
938+ key = { nft . id }
939+ to = { `${ PATH . OBJKT } /${ nft . id } ` } >
940+ < div className = { styles . container } >
941+ { renderMediaType ( {
942+ mimeType : nft . mime ,
943+ artifactUri : nft . artifact_uri ,
944+ displayUri : nft . display_uri ,
945+ displayView : true
946+ } ) }
937947 </ div >
938- < div className = { styles . cardCollect } >
939- < Purchase >
940- < div className = { styles . cardCollectPrice } >
941- collect for 24 tez
942- </ div >
943- </ Purchase >
948+ </ Button >
949+ < div className = { styles . cardContainer } >
950+ < div className = { styles . card } >
951+ < div className = { styles . cardText } >
952+ < div > OBJKT#{ nft . id } </ div >
953+ < div > { nft . title } </ div >
954+ </ div >
955+ < div className = { styles . cardCollect } >
956+ < Button onClick = { ( ) => this . collect ( nft . id , nft . id ) } >
957+ < Purchase >
958+ < div className = { styles . cardCollectPrice } >
959+ { nft . swaps && nft . swaps . length > 0 ? 'collect for ' + nft . swaps [ 0 ] . price / 1000000 + ' tez' : 'not for sale' }
960+ </ div >
961+ </ Purchase >
962+ </ Button >
963+ </ div >
944964 </ div >
945965 </ div >
946- < div className = { styles . container } >
947- { renderMediaType ( {
948- mimeType : nft . mime ,
949- artifactUri : nft . artifact_uri ,
950- displayUri : nft . display_uri ,
951- displayView : true
952- } ) }
953- </ div >
954- </ Button >
966+ </ div >
955967 )
956968 } ) }
957969 </ ResponsiveMasonry >
@@ -1057,35 +1069,39 @@ export default class Display extends Component {
10571069 >
10581070 < ResponsiveMasonry >
10591071 { this . state . items . map ( ( nft ) => {
1060- console . log ( 'nft asdfadf : ' + JSON . stringify ( nft ) )
1072+ console . log ( 'nft: ' + JSON . stringify ( nft ) )
10611073 return (
1062- < Button className = { styles . cardContainer }
1063- style = { { position : 'relative' } }
1064- key = { nft . token . id }
1065- to = { `${ PATH . OBJKT } /${ nft . token . id } ` } >
1074+ < div className = { styles . cardContainer } >
1075+ < Button
1076+ style = { { position : 'relative' } }
1077+ key = { nft . token . id }
1078+ to = { `${ PATH . OBJKT } /${ nft . token . id } ` } >
1079+ < div className = { styles . container } >
1080+ { renderMediaType ( {
1081+ mimeType : nft . token . mime ,
1082+ artifactUri : nft . token . artifact_uri ,
1083+ displayUri : nft . token . display_uri ,
1084+ displayView : true
1085+ } ) }
1086+ </ div >
1087+ </ Button >
10661088 < div className = { styles . card } >
10671089 < div className = { styles . cardText } >
10681090 < div > OBJKT#{ nft . token . id } </ div >
10691091 < div > { nft . token . title } </ div >
10701092 < div > { nft . token . creator . name } </ div >
10711093 </ div >
10721094 < div className = { styles . cardCollect } >
1073- < Purchase >
1074- < div className = { styles . cardCollectPrice } >
1075- collect for 24 tez
1076- </ div >
1077- </ Purchase >
1095+ < Button onClick = { ( ) => this . collect ( nft . token . id , nft . token . id ) } >
1096+ < Purchase >
1097+ < div className = { styles . cardCollectPrice } >
1098+ { nft . price ? 'collect for ' + nft . price / 1000000 : 'not for sale' }
1099+ </ div >
1100+ </ Purchase >
1101+ </ Button >
10781102 </ div >
10791103 </ div >
1080- < div className = { styles . container } >
1081- { renderMediaType ( {
1082- mimeType : nft . token . mime ,
1083- artifactUri : nft . token . artifact_uri ,
1084- displayUri : nft . token . display_uri ,
1085- displayView : true
1086- } ) }
1087- </ div >
1088- </ Button >
1104+ </ div >
10891105 )
10901106 } ) }
10911107 </ ResponsiveMasonry >
0 commit comments