Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit df3d375

Browse files
authored
Merge pull request #677 from prachi00/feat-unlist-button
#611 Unlist button in NFT
2 parents 4522581 + 43ba9da commit df3d375

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

src/components/rmrk/Gallery/AvailableActions.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,12 @@ export default class AvailableActions extends Mixins(RmrkVersionMixin) {
252252
});
253253
}
254254
255+
unlistNft() {
256+
// change the selected action to list and change meta value to 0
257+
this.selectedAction = 'LIST';
258+
this.meta = 0;
259+
this.submit();
260+
}
255261
}
256262
</script>
257263

src/components/rmrk/Gallery/GalleryItem.vue

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@
6969
<b-skeleton :count="2" size="is-large" :active="isLoading"></b-skeleton>
7070
<div class="price-block" v-if="hasPrice">
7171
<div class="label">{{ $t('price') }}</div>
72-
<div class="price-block__original">{{ nft.price | formatBalance(12, 'KSM') }}</div>
72+
<div class="price-block__container">
73+
<div class="price-block__original">{{ nft.price | formatBalance(12, 'KSM') }}</div>
74+
<b-button v-if="nft.currentOwner === accountId" type="is-warning" outlined @click="handleUnlist">{{ $t('Unlist') }}</b-button>
75+
</div>
7376
<!--<div class="label price-block__exchange">{{ this.nft.price | formatBalance(12, 'USD') }}</div>--> <!-- // price in USD -->
7477
</div>
7578

@@ -82,6 +85,7 @@
8285
<p class="subtitle">
8386
<Auth />
8487
<AvailableActions
88+
ref="actions"
8589
:accountId="accountId"
8690
:currentOwnerId="nft.currentOwner"
8791
:price="nft.price"
@@ -118,7 +122,7 @@ import { NFT, NFTMetadata, Emote } from '../service/scheme';
118122
import { sanitizeIpfsUrl, resolveMedia } from '../utils';
119123
import { emptyObject } from '@/utils/empty';
120124
121-
// import AvailableActions from './AvailableActions.vue';
125+
import AvailableActions from './AvailableActions.vue';
122126
import { notificationTypes, showNotification } from '@/utils/notification';
123127
// import Money from '@/components/shared/format/Money.vue';
124128
// import/ Sharing from '@/components/rmrk/Gallery/Item/Sharing.vue';
@@ -292,6 +296,12 @@ export default class GalleryItem extends Vue {
292296
showNotification(`INSTANCE REMOVED`, notificationTypes.warn)
293297
}
294298
}
299+
300+
protected handleUnlist() {
301+
//call unlist function from the AvailableActions component
302+
(this.$refs.actions as AvailableActions).unlistNft();
303+
}
304+
295305
}
296306
</script>
297307

@@ -408,6 +418,12 @@ hr.comment-divider {
408418
font-weight: 500;
409419
}
410420
421+
&__container {
422+
display: flex;
423+
justify-content: space-between;
424+
align-items: center;
425+
}
426+
411427
&__exchange {
412428
opacity: .6;
413429
color: $dark;

0 commit comments

Comments
 (0)