Skip to content

Commit

Permalink
kodadot#611 Unlist button in NFT
Browse files Browse the repository at this point in the history
  • Loading branch information
Prachi committed Sep 1, 2021
1 parent 2e5b23d commit 3936c66
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/components/rmrk/Gallery/AvailableActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,12 @@ export default class AvailableActions extends Mixins(RmrkVersionMixin) {
});
}
unlistNft() {
// change the selected action to list and change meta value to 0
this.selectedAction = 'LIST';
this.meta = 0;
this.submit();
}
}
</script>

20 changes: 18 additions & 2 deletions src/components/rmrk/Gallery/GalleryItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@
<b-skeleton :count="2" size="is-large" :active="isLoading"></b-skeleton>
<div class="price-block" v-if="hasPrice">
<div class="label">{{ $t('price') }}</div>
<div class="price-block__original">{{ nft.price | formatBalance(12, 'KSM') }}</div>
<div class="price-block__container">
<div class="price-block__original">{{ nft.price | formatBalance(12, 'KSM') }}</div>
<b-button type="is-warning" outlined @click="handleUnlist">{{ $t('Unlist') }}</b-button>
</div>
<!--<div class="label price-block__exchange">{{ this.nft.price | formatBalance(12, 'USD') }}</div>--> <!-- // price in USD -->
</div>

Expand All @@ -82,6 +85,7 @@
<p class="subtitle">
<Auth />
<AvailableActions
ref="actions"
:accountId="accountId"
:currentOwnerId="nft.currentOwner"
:price="nft.price"
Expand Down Expand Up @@ -118,7 +122,7 @@ import { NFT, NFTMetadata, Emote } from '../service/scheme';
import { sanitizeIpfsUrl, resolveMedia } from '../utils';
import { emptyObject } from '@/utils/empty';
// import AvailableActions from './AvailableActions.vue';
import AvailableActions from './AvailableActions.vue';
import { notificationTypes, showNotification } from '@/utils/notification';
// import Money from '@/components/shared/format/Money.vue';
// import/ Sharing from '@/components/rmrk/Gallery/Item/Sharing.vue';
Expand Down Expand Up @@ -292,6 +296,12 @@ export default class GalleryItem extends Vue {
showNotification(`INSTANCE REMOVED`, notificationTypes.warn)
}
}
protected handleUnlist() {
//call unlist function from the AvailableActions component
(this.$refs.actions as AvailableActions).unlistNft();
}
}
</script>

Expand Down Expand Up @@ -408,6 +418,12 @@ hr.comment-divider {
font-weight: 500;
}
&__container {
display: flex;
justify-content: space-between;
align-items: center;
}
&__exchange {
opacity: .6;
color: $dark;
Expand Down

0 comments on commit 3936c66

Please sign in to comment.