diff --git a/app/components/elements/nft/NFTTokenItem.jsx b/app/components/elements/nft/NFTTokenItem.jsx index d504be9..dfbd1f8 100644 --- a/app/components/elements/nft/NFTTokenItem.jsx +++ b/app/components/elements/nft/NFTTokenItem.jsx @@ -104,7 +104,7 @@ class NFTTokenItem extends Component { render() { const { token, tokenIdx, currentUser, page, assets } = this.props - const { json_metadata, image, selling, is_auction, auction_expiration, my_bet } = token + const { json_metadata, image, selling, is_auction, auction_expiration, my_bet, my_offer } = token let data if (json_metadata) { @@ -148,6 +148,12 @@ class NFTTokenItem extends Component { }, value: tt('g.transfer') }) } + if (!is_auction && !isMy && !my_offer) { + kebabItems.unshift({ link: '#', onClick: e => { + this.props.showPlaceOfferBet(e, tokenIdx) + }, value: tt('nft_tokens_jsx.place_offer') }) + } + const isCollection = page === 'collection' const isMarket = page === 'market' @@ -173,6 +179,28 @@ class NFTTokenItem extends Component { } + let myOffer + if (my_offer) { + const pr = Asset(my_offer.price) + const cancelOffer = (e) => { + e.preventDefault() + this.props.cancelOrder(my_offer.order_id, currentUser, () => { + this.props.refetch() + }, (err) => { + if (!err || err.toString() === 'Canceled') return + console.error(err) + alert(err.toString()) + }) + } + myOffer = + { + return pr.amountFloat + }} asset={pr} assets={assets} /> + + + } + let buttons if (last_price) { buttons =
@@ -229,13 +257,14 @@ class NFTTokenItem extends Component {
- {!isMy && !myBet && + {!isMy && !myBet && !myOffer && {'@' + token.owner} } - {token.has_offers && + {token.has_offers && isMy && {tt('nft_tokens_jsx.has_offers')} } {myBet} + {myOffer}
{data.title}