Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💄 Adjust some minor UI issues #803

Merged
merged 4 commits into from
Nov 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/assets/css/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,7 @@
@apply fill-current;
}
}

.tooltip-inner {
padding: 5px 10px 4px;
}
9 changes: 8 additions & 1 deletion src/components/NFTMessage/Identity.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
:is-avatar-outlined="isUserCivicLiker"
/>
<div>
<div class="text-[12px] text-medium-gray">{{ userLabel }}</div>
<div
v-if="isShowTypeLabel"
class="text-[12px] text-medium-gray"
>{{ userLabel }}</div>
<Label class="text-like-green" preset="h5">{{ userDisplayName }}</Label>
</div>
</NuxtLink>
Expand Down Expand Up @@ -49,6 +52,10 @@ export default {
type: [String, Array],
default: undefined,
},
isShowTypeLabel: {
type: Boolean,
default: true,
},
},
computed: {
toRoute() {
Expand Down
5 changes: 5 additions & 0 deletions src/components/NFTMessage/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<NFTMessageIdentity
v-if="fromWallet"
:type="fromType"
:is-show-type-label="isShowIdentityTypeLabel"
:wallet-address="fromWallet"
/>
<IconArrowLeft
Expand All @@ -40,6 +41,7 @@
<NFTMessageIdentity
v-if="toWallet"
:type="toType"
:is-show-type-label="isShowIdentityTypeLabel"
:wallet-address="toWallet"
/>
</div>
Expand Down Expand Up @@ -101,6 +103,9 @@ export default {
return this.$t('nft_message_type_generic');
}
},
isShowIdentityTypeLabel() {
return this.type === 'mint_nft';
},
},
};
</script>
19 changes: 14 additions & 5 deletions src/components/NFTPage/EventList/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
<td>
<Label
v-if="event.event === 'purchase'"
class="break-all"
:text="$t('nft_details_page_activity_list_event_collect')"
>
<template #prepend>
Expand All @@ -27,7 +26,6 @@
</Label>
<Label
v-else-if="event.event === 'transfer'"
class="break-all"
:text="$t('nft_details_page_activity_list_event_transfer')"
>
<template #prepend>
Expand All @@ -36,18 +34,28 @@
</Label>
<Label
v-else-if="event.event === 'mint_nft'"
class="break-all"
:text="$t('nft_details_page_activity_list_event_mint_nft')"
/>
>
<template #prepend>
<IconFlare />
</template>
</Label>
<Label
v-else-if="event.event === 'new_class'"
class="break-all"
:text="$t('nft_details_page_activity_list_event_create_class')"
>
<template #prepend>
<IconFlare />
</template>
</Label>
<Label
v-else
:text="event.event"
>
<template #prepend>
<IconCircle />
</template>
</Label>
</td>
<td>
<Label v-if="event.price" class="break-all" :text="event.price | formatNumber" />
Expand All @@ -72,6 +80,7 @@
<td>
<LinkV2 class="text-left" :href="getChainExplorerTx(event.txHash)">
<TimeAgo
class="px-[2px]"
long
tooltip
:datetime="event.timestamp"
Expand Down
6 changes: 3 additions & 3 deletions src/mixins/portfolio.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import throat from 'throat';
import {
NFT_CLASS_LIST_SORTING,
NFT_CLASS_LIST_SORTING_ORDER,
isWritingNFT,
checkIsWritingNFT,
} from '~/util/nft';
import clipboardMixin from '~/mixins/clipboard';
import userInfoMixin from '~/mixins/user-info';
Expand Down Expand Up @@ -79,7 +79,7 @@ export default {

const nftClassMapOfOther = new Map();
allNFTClassMap.forEach(nft => {
if (!isWritingNFT(this.getNFTClassMetadataById(nft.classId))) {
if (!checkIsWritingNFT(this.getNFTClassMetadataById(nft.classId))) {
nftClassMapOfOther.set(nft.classId, nft);
}
});
Expand Down Expand Up @@ -335,7 +335,7 @@ export default {
});

// wait for metadata to determine if it is writing NFT
if (isWritingNFT(metadata)) {
if (checkIsWritingNFT(metadata)) {
try {
await this.fetchNFTPurchaseInfo(classId);
} catch (error) {
Expand Down
6 changes: 3 additions & 3 deletions src/store/modules/nft.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as api from '@/util/api';
import {
NFT_CLASS_LIST_SORTING,
NFT_CLASS_LIST_SORTING_ORDER,
isWritingNFT,
checkIsWritingNFT,
isValidHttpUrl,
formatOwnerInfoFromChain,
getNFTsRespectDualPrefix,
Expand Down Expand Up @@ -48,10 +48,10 @@ function compareIsWritingNFT(getters, classIdA, classIdB) {
const aPurchaseData = getters.getNFTClassPurchaseInfoById(classIdA);
const bPurchaseData = getters.getNFTClassPurchaseInfoById(classIdB);
const aIsWritingNFT =
isWritingNFT(aMetadata) &&
checkIsWritingNFT(aMetadata) &&
(aPurchaseData?.price || aPurchaseData?.lastSoldPrice) !== undefined;
const bIsWritingNFT =
isWritingNFT(bMetadata) &&
checkIsWritingNFT(bMetadata) &&
(bPurchaseData?.price || bPurchaseData?.lastSoldPrice) !== undefined;
if (aIsWritingNFT && !bIsWritingNFT) return -1;
if (!aIsWritingNFT && bIsWritingNFT) return 1;
Expand Down
2 changes: 1 addition & 1 deletion src/util/nft.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export function getNFTClassCollectionType(classMetadata) {
}
}

export function isWritingNFT(classMetadata) {
export function checkIsWritingNFT(classMetadata) {
return (
getNFTClassCollectionType(classMetadata) ===
nftClassCollectionType.WritingNFT
Expand Down