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

fix: Description more important than Properties #4738

Merged
merged 1 commit into from
Jan 17, 2023
Merged
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
40 changes: 18 additions & 22 deletions components/gallery/GalleryItemDescription.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
<template>
<o-tabs v-model="activeTab" expanded content-class="o-tabs__content--fixed">
<!-- description tab -->
<o-tab-item value="0" :label="$t('tabs.description')" class="p-5">
<div class="mb-3 is-flex">
<span class="mr-2">{{ $t('tabs.tabDescription.made') }}:</span>
<nuxt-link
v-if="nft?.issuer"
:to="`/${urlPrefix}/u/${nft?.issuer}`"
class="has-text-link">
<Identity ref="identity" :address="nft?.issuer" />
</nuxt-link>
</div>

<vue-markdown
:source="nftMetadata?.description?.replaceAll('\n', ' \n') || ''"
:style="{ wordBreak: 'break-word' }" />
</o-tab-item>

<!-- properties tab -->
<DisablableTab
value="0"
value="1"
:disabled="propertiesTabDisabled"
:label="$t('tabs.properties')"
:disabled-tooltip="$t('tabs.noPropertiesForNFT')">
Expand All @@ -22,23 +39,6 @@
</o-table>
</DisablableTab>

<!-- description tab -->
<o-tab-item value="1" :label="$t('tabs.description')" class="p-5">
<div class="mb-3 is-flex">
<span class="mr-2">{{ $t('tabs.tabDescription.made') }}:</span>
<nuxt-link
v-if="nft?.issuer"
:to="`/${urlPrefix}/u/${nft?.issuer}`"
class="has-text-link">
<Identity ref="identity" :address="nft?.issuer" />
</nuxt-link>
</div>

<vue-markdown
:source="nftMetadata?.description?.replaceAll('\n', ' \n') || ''"
:style="{ wordBreak: 'break-word' }" />
</o-tab-item>

<!-- details tab -->
<o-tab-item value="2" :label="$t('tabs.details')" class="p-5">
<!-- <div class="is-flex is-justify-content-space-between">
Expand Down Expand Up @@ -113,10 +113,6 @@ const propertiesTabDisabled = computed(() => {
return !nftMetadata.value.attributes?.length
})

watch(propertiesTabDisabled, () => {
activeTab.value = propertiesTabDisabled.value ? '1' : '0'
})

const metadataMimeType = ref('application/json')
const metadataURL = ref('')

Expand Down