Skip to content

Commit 28f5cea

Browse files
committed
fix both creations/collections collect button
1 parent 89c538a commit 28f5cea

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

src/context/HicetnuncContext.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,10 @@ class HicetnuncContextProviderClass extends Component {
391391
},
392392

393393
collect: async (swap_id, amount) => {
394+
console.log('collectv2')
395+
console.log('swap_id ' + swap_id)
396+
console.log('xtz ' + amount)
397+
console.log('collectv2')
394398
return await Tezos.wallet
395399
.at(this.state.proxyAddress || this.state.v2)
396400
.then((c) =>

src/pages/display/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ query creatorGallery($address: String!) {
8989
description
9090
supply
9191
swaps(order_by: {price: asc}, limit: 1, where: {amount_left: {_gte: "1"}, status: {_eq: "0"}}) {
92+
id
9293
status
9394
amount_left
9495
creator_id
@@ -997,7 +998,7 @@ export default class Display extends Component {
997998
<div className={styles.cardTitle}>{nft.title}</div>
998999
</div>
9991000
<div className={styles.cardCollect}>
1000-
<Button onClick={() => this.collect(nft.id, nft.id)}>
1001+
<Button onClick={() => this.context.collect(nft.swaps[0].id, nft.swaps[0].price)}>
10011002
<Purchase>
10021003
<div className={styles.cardCollectPrice}>
10031004
{nft.swaps && nft.swaps.length > 0 ? 'collect for ' + nft.swaps[0].price / 1000000 + ' tez' : 'not for sale'}
@@ -1136,7 +1137,7 @@ export default class Display extends Component {
11361137
<div>{nft.token.creator.name}</div>
11371138
</div>
11381139
<div className={styles.cardCollect}>
1139-
<Button onClick={() => this.collect(nft.token.id, nft.token.id)}>
1140+
<Button onClick={() => this.context.collect(nft.id, nft.price)}>
11401141
<Purchase>
11411142
<div className={styles.cardCollectPrice}>
11421143
{nft.price ? 'collect for ' + nft.price / 1000000 : 'not for sale'}

src/pages/display/styles.module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@
101101
border-right: 2px solid var(--background-color);
102102
border-bottom: 2px solid var(--background-color);
103103
margin-bottom: 20px;
104+
margin-left: 20px;
104105
margin-right: 20px;
105106

106107
.cardCollectPrice {

0 commit comments

Comments
 (0)