From 9a3c5e513d47ef8568a7f3418eea20a0309c2d8f Mon Sep 17 00:00:00 2001 From: Jarsen <695552027@qq.com> Date: Fri, 17 Feb 2023 12:20:20 +0800 Subject: [PATCH 01/17] refactor: Navbar Vue composition api --- components/Navbar.vue | 239 +++++++++++++++++------------------------- 1 file changed, 95 insertions(+), 144 deletions(-) diff --git a/components/Navbar.vue b/components/Navbar.vue index 341042271c..eec3992bcd 100644 --- a/components/Navbar.vue +++ b/components/Navbar.vue @@ -1,5 +1,6 @@ - + :chain="urlPrefix" /> + :chain="urlPrefix" /> - From 13fefcdeaf06710cdd182112ab78d8b46a0e40f7 Mon Sep 17 00:00:00 2001 From: Jarsen <31397967+Jarsen136@users.noreply.github.com> Date: Sat, 18 Feb 2023 16:09:39 +0800 Subject: [PATCH 02/17] Update components/Navbar.vue Co-authored-by: roiLeo --- components/Navbar.vue | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/components/Navbar.vue b/components/Navbar.vue index eec3992bcd..623b780a37 100644 --- a/components/Navbar.vue +++ b/components/Navbar.vue @@ -170,9 +170,7 @@ const route = useRoute() const account = computed(() => $store.getters.getAuthAddress) -const isCreateVisible = computed(() => { - return createVisible(urlPrefix.value) -}) +const isCreateVisible = computed(() => createVisible(urlPrefix.value)) const isLandingPage = computed(() => route.name === 'index') const isDarkMode = computed( From 2f98615ba368eb74992186654f3404d18f0d0f3c Mon Sep 17 00:00:00 2001 From: daiagi Date: Wed, 22 Feb 2023 16:15:31 +0700 Subject: [PATCH 03/17] init --- components/collection/HeroButtons.vue | 31 +++++++++++++++++++ .../ui/src/components/NeoButton/NeoButton.vue | 7 +++-- 2 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 components/collection/HeroButtons.vue diff --git a/components/collection/HeroButtons.vue b/components/collection/HeroButtons.vue new file mode 100644 index 0000000000..572af01747 --- /dev/null +++ b/components/collection/HeroButtons.vue @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + diff --git a/libs/ui/src/components/NeoButton/NeoButton.vue b/libs/ui/src/components/NeoButton/NeoButton.vue index e23a805b06..8f30c7eb26 100644 --- a/libs/ui/src/components/NeoButton/NeoButton.vue +++ b/libs/ui/src/components/NeoButton/NeoButton.vue @@ -10,7 +10,7 @@ :variant="variant" :disabled="disabled" :expanded="expanded" - icon-pack="fa" + :icon-pack="iconPack" :label="label" class="is-neo" v-bind="$attrs"> @@ -22,17 +22,20 @@ import { OButton } from '@oruga-ui/oruga' import { NeoButtonVariant } from '@kodadot1/brick' -defineProps<{ +const props = defineProps<{ size?: 'small' | 'medium' | 'large' disabled?: boolean expanded?: boolean icon?: string + iconPack?: string label?: string active?: boolean fixedWidth?: boolean noShadow?: boolean variant?: NeoButtonVariant }>() + +const iconPack = computed(() => props?.iconPack || 'fa') + + diff --git a/components/collection/utils/useCollectionDetails.ts b/components/collection/utils/useCollectionDetails.ts index 4b2eb5be96..f28d19ac1c 100644 --- a/components/collection/utils/useCollectionDetails.ts +++ b/components/collection/utils/useCollectionDetails.ts @@ -1,5 +1,5 @@ import { getVolume } from '@/utils/math' -import { NFT } from '@/components/rmrk/service/scheme' +import { CollectionMetadata, NFT } from '@/components/rmrk/service/scheme' import { NFTListSold } from '@/components/identity/utils/useIdentity' type Stats = { @@ -10,6 +10,16 @@ type Stats = { collectionTradedVolumeNumber?: bigint } +export type CollectionEntityMinimal = { + id: string + issuer: string + meta: CollectionMetadata + metadata: string + name: string + currentOwner: string + type: string +} + const differentOwner = (nft: { issuer: string currentOwner: string @@ -99,3 +109,21 @@ export function useCollectionSoldData({ address, collectionId }) { return { nftEntities } } + +export const useCollectionMinimal = ({ collectionId }) => { + const collection = ref() + + const { data } = useGraphql({ + queryName: 'collectionByIdMinimal', + variables: { + id: collectionId, + }, + }) + + watch(data, (result) => { + if (result?.collectionEntityById) { + collection.value = result.collectionEntityById + } + }) + return { collection } +} diff --git a/layouts/explore-layout.vue b/layouts/explore-layout.vue index bc64ab1ef2..66d4dba391 100644 --- a/layouts/explore-layout.vue +++ b/layouts/explore-layout.vue @@ -4,7 +4,11 @@ - header collection here + + + + + import ExploreTabsFilterSort from '@/components/explore/ExploreIndex.vue' import MobileFilter from '@/components/explore/MobileFilter.vue' +import HeroButtons from '~~/components/collection/HeroButtons.vue' const { $config } = useNuxtApp() const route = useRoute() diff --git a/queries/subsquid/general/collectionByIdMinimal.graphql b/queries/subsquid/general/collectionByIdMinimal.graphql new file mode 100644 index 0000000000..f63bff91ba --- /dev/null +++ b/queries/subsquid/general/collectionByIdMinimal.graphql @@ -0,0 +1,18 @@ +query collectionByIdMinimal($id: String!) { + collectionEntityById(id: $id) { + id + issuer + meta { + animationUrl + description + id + image + name + type + } + metadata + name + currentOwner + type + } +} From 6eb70bcce8196e6a6b64f24bb5d82eda34874aa0 Mon Sep 17 00:00:00 2001 From: daiagi Date: Thu, 23 Feb 2023 14:45:05 +0700 Subject: [PATCH 08/17] put herobuttons inside container --- layouts/explore-layout.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/explore-layout.vue b/layouts/explore-layout.vue index 66d4dba391..2e18cb21c8 100644 --- a/layouts/explore-layout.vue +++ b/layouts/explore-layout.vue @@ -5,7 +5,7 @@ - + From 135939f11fb6bfb54df6ce6b0dae1cba3274afe0 Mon Sep 17 00:00:00 2001 From: daiagi Date: Thu, 23 Feb 2023 14:46:50 +0700 Subject: [PATCH 09/17] some padding --- layouts/explore-layout.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/explore-layout.vue b/layouts/explore-layout.vue index 2e18cb21c8..03965c174d 100644 --- a/layouts/explore-layout.vue +++ b/layouts/explore-layout.vue @@ -5,7 +5,7 @@ - + From bdb054206d4dfa20637a5e464d28e993d31ac1c7 Mon Sep 17 00:00:00 2001 From: daiagi Date: Thu, 23 Feb 2023 14:56:55 +0700 Subject: [PATCH 10/17] make deepsource happy --- components/collection/HeroButtons.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/collection/HeroButtons.vue b/components/collection/HeroButtons.vue index 89124adc09..e10922e5d8 100644 --- a/components/collection/HeroButtons.vue +++ b/components/collection/HeroButtons.vue @@ -88,6 +88,7 @@ import { const route = useRoute() const { accountId } = useAuth() const { $i18n } = useNuxtApp() +const collection = ref() const collectionId = computed(() => route.params.id) const realworldFullPath = computed( () => `${window.location.origin}${route.fullPath}` @@ -98,8 +99,6 @@ const isOwner = computed(() => const hashtags = 'KusamaNetwork,KodaDot' const sharingLabel = $i18n.t('sharing.collection') -const collection = ref() - const { collection: data } = useCollectionMinimal({ collectionId: collectionId.value, }) From f6980bb81d62a5e3757eb3b2577ef408c9dcc6ca Mon Sep 17 00:00:00 2001 From: maderi21 <102800574+maderi21@users.noreply.github.com> Date: Thu, 23 Feb 2023 09:09:49 +0100 Subject: [PATCH 11/17] fix dropdown button variant --- components/explore/ExploreSort.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/components/explore/ExploreSort.vue b/components/explore/ExploreSort.vue index c8776aff76..2f2080d991 100644 --- a/components/explore/ExploreSort.vue +++ b/components/explore/ExploreSort.vue @@ -14,6 +14,7 @@ Sort By From 593e34bc1f42e4f01b1c4650edb1beb94302db93 Mon Sep 17 00:00:00 2001 From: maderi21 <102800574+maderi21@users.noreply.github.com> Date: Thu, 23 Feb 2023 10:29:40 +0100 Subject: [PATCH 12/17] fix color on count --- components/explore/ExploreSort.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/explore/ExploreSort.vue b/components/explore/ExploreSort.vue index 2f2080d991..b841349f04 100644 --- a/components/explore/ExploreSort.vue +++ b/components/explore/ExploreSort.vue @@ -14,7 +14,6 @@ Sort By @@ -153,7 +152,7 @@ onMounted(() => { @include ktheme() { border: 1px solid theme('border-color'); - background: theme('k-accent'); + background: theme('k-primary'); color: theme('black'); } } From ce9520eb672041f882334591ec55d0c466ecb876 Mon Sep 17 00:00:00 2001 From: maderi21 <102800574+maderi21@users.noreply.github.com> Date: Thu, 23 Feb 2023 10:48:59 +0100 Subject: [PATCH 13/17] add mintnft activity for non-rmrk2 chains --- .../GalleryItemTabsPanel/GalleryItemActivityTable.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/gallery/GalleryItemTabsPanel/GalleryItemActivityTable.vue b/components/gallery/GalleryItemTabsPanel/GalleryItemActivityTable.vue index 0617e5fddb..8190e1505d 100644 --- a/components/gallery/GalleryItemTabsPanel/GalleryItemActivityTable.vue +++ b/components/gallery/GalleryItemTabsPanel/GalleryItemActivityTable.vue @@ -104,9 +104,10 @@ const { data, loading } = useGraphql({ clientName: urlPrefix.value, variables: { id: dprops.nftId, - interaction: dprops.interactions.filter( - (i) => i !== 'MINTNFT' && i !== 'CONSUME' - ), + interaction: + urlPrefix.value === 'rmrk2' + ? dprops.interactions.filter((i) => i !== 'MINTNFT' && i !== 'CONSUME') + : dprops.interactions, limit: 100, }, }) From e29f24a812ae519f6a75d94a800c58f4014d2204 Mon Sep 17 00:00:00 2001 From: daiagi Date: Thu, 23 Feb 2023 18:07:53 +0700 Subject: [PATCH 14/17] align to figma --- components/collection/HeroButtons.vue | 136 ++++++++++++-------------- 1 file changed, 64 insertions(+), 72 deletions(-) diff --git a/components/collection/HeroButtons.vue b/components/collection/HeroButtons.vue index e10922e5d8..2c39a31b36 100644 --- a/components/collection/HeroButtons.vue +++ b/components/collection/HeroButtons.vue @@ -1,81 +1,73 @@ - + - - - - - - + + + + + + + + - + + {{ $i18n.t('share.copyLink') }} + + + {{ $i18n.t('share.qrCode') }} + + - - - - - - - - - - - - - - - - + twitter-user="KodaDot"> + {{ $i18n.t('share.twitter') }} - + + - + - Delete - Customize + + {{ $i18n.t('moreActions.delete') }} + + + {{ $i18n.t('moreActions.customize') }} + + + + + {{ $i18n.t('moreActions.reportNFT') }} + + + + {{ $i18n.t('moreActions.download') }} + + + - - Report - + + + + {{ collection?.name }} + + + + + + + - - From 5bfb3ac847f699b85b14c169ea739d7757a9d718 Mon Sep 17 00:00:00 2001 From: daiagi Date: Thu, 23 Feb 2023 18:08:06 +0700 Subject: [PATCH 15/17] translations --- locales/en.json | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/locales/en.json b/locales/en.json index 0e2d1745d0..b627573b2e 100644 --- a/locales/en.json +++ b/locales/en.json @@ -1115,6 +1115,19 @@ "join": "Join Our Community", "subscribeLabel": "Subscribe" }, + "share": { + "copyLink": "Copy Link", + "qrCode": "QR Code", + "twitter": "Share on Twitter" + }, + + "moreActions": { + "download": "Download", + "reportNFT": "Report NFT", + "delete": "Delete", + "customize": "Customize" + }, + "collectionCard": { "volume": "Volume", "items": "Items" From a4711510ee4b008c6daed50f7d3e90e887fdf172 Mon Sep 17 00:00:00 2001 From: daiagi Date: Fri, 24 Feb 2023 00:33:08 +0700 Subject: [PATCH 16/17] implement code review --- components/collection/HeroButtons.vue | 29 +++++++++------------------ layouts/explore-layout.vue | 2 +- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/components/collection/HeroButtons.vue b/components/collection/HeroButtons.vue index 2c39a31b36..f39f863e39 100644 --- a/components/collection/HeroButtons.vue +++ b/components/collection/HeroButtons.vue @@ -11,8 +11,8 @@ + v-clipboard:copy="currentURL" + @click.native="toast(`${$i18n.t('toast.urlCopy')}`)"> {{ $i18n.t('share.copyLink') }} @@ -23,7 +23,7 @@ tag="div" network="twitter" :hashtags="hashtags" - :url="realworldFullPath" + :url="currentURL" :title="sharingLabel" twitter-user="KodaDot"> {{ $i18n.t('share.twitter') }} @@ -63,7 +63,7 @@ {{ collection?.name }} - + @@ -73,18 +73,15 @@
{{ collection?.name }}