Skip to content

Commit

Permalink
🔀 Merge #2002 into deploy/rinkeby
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraHuang22 committed Dec 30, 2024
2 parents 76c8a35 + d3273c8 commit fcd314f
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 63 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 10 additions & 11 deletions src/assets/images/nft/books/collector-message-item-background.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions src/components/NFTPage/CollectorMessageList/Identity.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
/>
<div>
<p class="text-like-green hover:underline" align="center">
{{ userDisplayNameFull | ellipsisCollectorAddress }}
{{ formattedUserDisplayNameFull }}
</p>
</div>
</component>
Expand All @@ -41,15 +41,12 @@
import { mapActions } from 'vuex';
import { createUserInfoMixin } from '~/mixins/user-info';
import { ellipsisCollectorAddress } from '~/util/ui';
import { ellipsis } from '~/util/ui';
const userInfoMixin = createUserInfoMixin({ walletKey: 'walletAddress' });
export default {
name: 'NFTPageCollectorMessageListIdentity',
filters: {
ellipsisCollectorAddress,
},
mixins: [userInfoMixin],
props: {
walletAddress: {
Expand Down Expand Up @@ -85,6 +82,9 @@ export default {
query: { tab: this.isCreatedTab ? 'created' : 'collected' },
});
},
formattedUserDisplayNameFull() {
return ellipsis(this.userDisplayNameFull, 13, 0);
},
},
watch: {
walletAddress() {
Expand Down
12 changes: 6 additions & 6 deletions src/components/NFTPage/CollectorMessageList/Item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
]"
:style="bgStyle"
>
<p class="block text-[16px] line-clamp-4">{{ buyerMessage }}</p>
<p class="block text-[16px] line-clamp-4" v-text="buyerMessage" />
<NFTPageCollectorMessageListIdentity
:is-show-type-label="false"
:wallet-address="message.id"
Expand All @@ -31,12 +31,12 @@
/>

<Identity
v-if="authorReplied"
v-if="hasAuthorReplied"
:class="[
'absolute bottom-0 right-[6px]',
'!hidden',
'transition-all duration-100',
authorReplied
hasAuthorReplied
? 'group-hover:!block group-hover:right-[8px]'
: 'hidden',
]"
Expand All @@ -45,10 +45,10 @@
/>

<svg
v-if="authorReplied"
v-if="hasAuthorReplied"
:class="[
'absolute bottom-0 right-[6px]',
authorReplied ? 'group-hover:right-[22px]' : '',
{ 'group-hover:right-[22px]': hasAuthorReplied },
]"
width="20"
height="20"
Expand Down Expand Up @@ -99,7 +99,7 @@ export default {
buyerMessage() {
return this.message?.buyerMessage;
},
authorReplied() {
hasAuthorReplied() {
return this.message?.authorReply;
},
messagesPageLink() {
Expand Down
2 changes: 1 addition & 1 deletion src/components/NFTPage/CollectorMessageList/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default {
return loopedMessages;
},
durationTime() {
return `${this.messages.length * this.durationMultiplier}s`;
return `${this.messages.length * this.durationMultiplier}`;
},
},
mounted() {
Expand Down
11 changes: 5 additions & 6 deletions src/components/ScrollingList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ export default {
name: 'ScrollingList',
props: {
animationDuration: {
type: String,
default: '60s',
type: [String, Number],
default: '60',
},
},
data() {
Expand All @@ -47,7 +47,7 @@ export default {
},
computed: {
durationTime() {
return this.animationDuration;
return `${this.animationDuration}s`;
},
},
methods: {
Expand All @@ -74,12 +74,11 @@ export default {

<style scoped>
@screen laptop {
.animate-scroll {
.animate-scroll,
.animate-scroll.delay {
animation: scroll var(--animation-duration, 60s) infinite linear;
}
.animate-scroll.delay {
animation: scroll var(--animation-duration, 60s) infinite linear;
animation-delay: calc(var(--animation-duration, 60s) * -1);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/nft/class/_classId/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ export default {
isOpeningCheckoutPage: false,
isHistoryInfoLoading: false,
isFinishedLoadingHistory: false,
hasHistoryInfoLoaded: false,
isOpeningCollectorListDialog: false,
};
},
Expand Down Expand Up @@ -1222,7 +1222,7 @@ export default {
this.updateNFTHistory({ getAllUserInfo: false }),
]);
this.isHistoryInfoLoading = false;
this.isFinishedLoadingHistory = true;
this.hasHistoryInfoLoaded = true;
},
getPurchaseEventParams(edition) {
const customPriceInDecimal = this.customPrice
Expand Down
28 changes: 7 additions & 21 deletions src/util/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,15 @@ const largeNumFormatter = new Intl.NumberFormat('en-US', {
maximumFractionDigits: 2,
});

export function ellipsis(value) {
if (value) {
const len = value.length;
const dots = '...';
if (!value) return '';
if (value.length > 20) {
return value.substring(0, 8) + dots + value.substring(len - 6, len);
}
return value;
}
return value;
}
export function ellipsis(value, maxLength = 20, endLength = 6) {
if (!value) return '';
const len = value.length;
const dots = '...';

export function ellipsisCollectorAddress(value) {
if (value) {
const len = value.length;
const dots = '...';
if (!value) return '';
if (value.length > 10) {
return value.substring(0, 8) + dots;
}
return value;
if (len > maxLength) {
return value.substring(0, 8) + dots + value.substring(len - endLength, len);
}

return value;
}

Expand Down

0 comments on commit fcd314f

Please sign in to comment.