From a6bd82eb9329d755f8985c7360720b9178049904 Mon Sep 17 00:00:00 2001 From: AuroraHuang22 <75730405+AuroraHuang22@users.noreply.github.com> Date: Wed, 3 Jan 2024 16:24:05 +0800 Subject: [PATCH] Add related link to likerland (#430) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 💄 Add a button that leads to the likerland NFT page * 💄 Add portfolio link when searching owner * 💄 Update nftUrl button style * 🎨 Use classId as condition for displaying the NFT button * 🎨 Add noopener for ownerPortfolioUrl --- locales/en.json | 2 ++ pages/search/_keyword.vue | 45 ++++++++++++++++++++++++++++-------- pages/view/_iscnId/index.vue | 30 ++++++++++++++++++++++-- utils/cosmos/index.ts | 15 +++++++----- 4 files changed, 75 insertions(+), 17 deletions(-) diff --git a/locales/en.json b/locales/en.json index 349de5b9..0878b09c 100644 --- a/locales/en.json +++ b/locales/en.json @@ -278,6 +278,7 @@ "NFTPortal.button.download.iscn": "Download JSON", "NFTPortal.button.mint": "Mint NFT", "NFTPortal.button.mint.book": "Mint Book", + "NFTPortal.button.check.nft": "Check NFT", "NFTPortal.button.next":"Next", "NFTPortal.button.mintContinueLong": "Continue to mint Writing NFTs", "NFTPortal.button.mintContinue": "Continue to mint NFT", @@ -379,6 +380,7 @@ "UploadForm.warning": "Oops, file is too large. The file size should not exceed {size}MB", "WorksPage.empty.label": "No works", "WorksPage.label.search.result": "Search result for :", + "WorksPage.label.check.owner.portfolio": "check owner portfolio", "WorksPage.label.portfolio": "View my Writing NFT Portfolio", "WorksPage.pagination.button.first": "First", "WorksPage.pagination.button.last": "Last", diff --git a/pages/search/_keyword.vue b/pages/search/_keyword.vue index 67ad716e..f481664c 100644 --- a/pages/search/_keyword.vue +++ b/pages/search/_keyword.vue @@ -54,11 +54,25 @@ -
+
ISCNRecordWithID[] | PromiseLike @iscnModule.Action queryISCNByField!: ( - arg0: { + arg0: { iscnId?: string, owner?: string, contentFingerprint?: string, stakeholderId?: string, stakeholderName?: string, - keyword?: string, + keyword?: string, }) => ISCNRecordWithID[] | PromiseLike pageNumber = Number(this.$route.query.page) || 0 closeWarning = false + owner: any = '' + iscnId: any = '' get queryAllTerm(): string { const { q } = this.$route.query @@ -161,6 +178,14 @@ export default class SearchPage extends Vue { return !!this.errorMessage } + get searchResultText() { + return this.owner || this.iscnId + } + + get ownerPortfolioUrl() { + return `${LIKER_LAND_URL}/en/${this.owner}?tab=created` + } + mounted() { this.search() } @@ -177,19 +202,21 @@ export default class SearchPage extends Vue { }); } - async search(){ + async search() { logTrackerEvent(this, 'ISCNSearch', 'ISCNSearchResult', this.queryAllTerm, 1) if (this.queryAllTerm) { await this.queryISCNByKeyword(this.queryAllTerm) } else { - const { + const { iscnId, owner, content_fingerprint: contentFingerprint, stakeholder_id: stakeholderId, - stakeholder_name: stakeholderName, + stakeholder_name: stakeholderName, keyword, } = this.$route.query; + this.owner = owner; + this.iscnId = iscnId const searchObject = { iscnId: iscnId as string, owner: owner as string, diff --git a/pages/view/_iscnId/index.vue b/pages/view/_iscnId/index.vue index 211c07fb..dc9ba6b6 100644 --- a/pages/view/_iscnId/index.vue +++ b/pages/view/_iscnId/index.vue @@ -86,6 +86,7 @@ :class="[ 'flex', 'justify-end', + 'items-center', 'w-full', 'pt-[24px]', 'gap-[8px]', @@ -119,6 +120,18 @@ :to="localeLocation({ name: 'nft-iscn-iscnId', params: { iscnId: iscnId }, query: mintQueries })" :text="$t('NFTPortal.button.mint')" /> +
+ +