Skip to content

Commit

Permalink
🔀 Merge #1676 into deploy/rinkeby
Browse files Browse the repository at this point in the history
  • Loading branch information
williamchong committed Jul 17, 2024
2 parents 13b965c + 2a9e9da commit f5ac533
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 16 deletions.
31 changes: 21 additions & 10 deletions src/components/NFTBook/ItemCardV2.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,41 +13,41 @@
:class-aspect-ratio="classCoverFrameAspectRatio"
cover-class="group-hover:scale-[1.02] transition-transform"
:cover-resize="coverResize"
:src="NFTImageUrl"
:alt="NFTName"
:to="nftCollectRoute"
:src="productImageUrl"
:alt="productName"
:to="viewInfoLocation"
:event="isLinkDisabled ? '' : 'click'"
@click.native="$emit('click-cover', $event)"
/>

<div
class="mt-[8px] text-[#333] text-[1rem] font-[500] laptop:text-[1.125rem]"
>
{{ NFTName }}
{{ productName }}
</div>

<div class="text-[#8B8B8B] text-[0.875rem] laptop:text-[1rem]">
{{ (iscnWorkAuthor || creatorDisplayName) | ellipsis }}
</div>

<div class="mt-[16px] text-[#1F1F1F] text-[0.875rem] laptop:text-[1rem]">
{{ nftBookAvailablePriceLabel || $t('nft_details_page_label_sold_out') }}
{{ productAvailablePriceLabel || $t('nft_details_page_label_sold_out') }}
</div>
</div>
</template>

<script>
import nftMixin from '~/mixins/nft';
import nftOrCollectionMixin from '~/mixins/nft-or-collection';
import { ellipsis } from '~/util/ui';
export default {
filters: {
ellipsis,
},
mixins: [nftMixin],
mixins: [nftOrCollectionMixin],
props: {
classId: {
itemId: {
type: String,
required: true,
},
Expand All @@ -69,9 +69,16 @@ export default {
},
},
computed: {
classId() {
return this.itemId.startsWith('likenft1') ? this.itemId : '';
},
collectionId() {
return this.itemId.startsWith('col') ? this.itemId : '';
},
creatorDisplayName() {
return (
this.getUserInfoByAddress(this.iscnOwner)?.displayName || this.iscnOwner
this.getUserInfoByAddress(this.productOwner)?.displayName ||
this.productOwner
);
},
},
Expand All @@ -80,7 +87,11 @@ export default {
},
methods: {
async fetchInfo() {
await this.lazyFetchNFTClassAggregatedData();
if (this.isCollection) {
await this.lazyFetchNFTCollectionInfo();
} else {
await this.lazyFetchNFTClassAggregatedData();
}
},
},
};
Expand Down
5 changes: 5 additions & 0 deletions src/mixins/nft-or-collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ export default {
productPrice() {
return this.isCollection ? this.collectionPrice : this.NFTPrice;
},
productAvailablePriceLabel() {
return this.isCollection
? this.collectionAvailablePriceLabel
: this.nftBookAvailablePriceLabel;
},
viewInfoLocation() {
return this.isCollection
? this.localeLocation({
Expand Down
8 changes: 4 additions & 4 deletions src/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@likecoin/iscn-js": "^0.6.9",
"@likecoin/nuxt-google-optimize": "^0.5.3-like.11",
"@likecoin/ui-vue": "^0.7.1",
"@likecoin/wallet-connector": "^0.26.2",
"@likecoin/wallet-connector": "^0.26.3",
"@nuxtjs/axios": "^5.12.2",
"@nuxtjs/i18n": "^7.3.1",
"@nuxtjs/sentry": "^5.1.7",
Expand Down
2 changes: 1 addition & 1 deletion src/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@
>
<li v-for="item in bookstoreItemsInGrid" :key="item.classId">
<NFTBookItemCardV2
:class-id="item.classId"
:item-id="item.classId"
class-cover-frame-aspect-ratio="min-h-[360px] laptop:min-h-[0] aspect-[4/5]"
:cover-resize="300"
:is-link-disabled="item.isMultiple"
Expand Down

0 comments on commit f5ac533

Please sign in to comment.