From b62afb95181a7f75a4417fc74a4fb1dca18fdeb8 Mon Sep 17 00:00:00 2001 From: Shubham Kukreti <57281769+KukretiShubham@users.noreply.github.com> Date: Thu, 24 Oct 2024 13:56:00 +0900 Subject: [PATCH 1/8] lint --- .../passport/components/PassportClip.vue | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/src/pages/passport/components/PassportClip.vue b/src/pages/passport/components/PassportClip.vue index 7925741db..6140cad43 100644 --- a/src/pages/passport/components/PassportClip.vue +++ b/src/pages/passport/components/PassportClip.vue @@ -44,6 +44,15 @@ const fetchClub = async (api: string) => { .catch(always(null)) } +const shareClip = () => { + navigator.share({ + // please replace the title and text with the actual values + title: props.item.description, + text: props.item.description, + url: window.location.href, + }) +} + onMounted(async () => { const clubApiPri = await fetchClub(`/${API_PATH}`) const clubApi = clubApiPri ? clubApiPri : await fetchClub(clubApiAlt.value) @@ -68,5 +77,55 @@ onMounted(async () => { />

{{ clubName }} + From 3ffdd5dc9cacb70039608a30fd0283a8011f0011 Mon Sep 17 00:00:00 2001 From: Shubham Kukreti <57281769+KukretiShubham@users.noreply.github.com> Date: Thu, 24 Oct 2024 17:06:17 +0900 Subject: [PATCH 2/8] improve: share url construction --- src/pages/passport/[eoa]/[...ids]/index.astro | 2 +- src/pages/passport/components/PassportClip.vue | 5 ++++- src/pages/passport/components/PassportClips.vue | 9 ++++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/pages/passport/[eoa]/[...ids]/index.astro b/src/pages/passport/[eoa]/[...ids]/index.astro index 49d6e006d..3af475821 100644 --- a/src/pages/passport/[eoa]/[...ids]/index.astro +++ b/src/pages/passport/[eoa]/[...ids]/index.astro @@ -254,7 +254,7 @@ const passportSkinClips = await whenDefined( passportSkinClips?.length && (
- +
) diff --git a/src/pages/passport/components/PassportClip.vue b/src/pages/passport/components/PassportClip.vue index 6140cad43..2450475e6 100644 --- a/src/pages/passport/components/PassportClip.vue +++ b/src/pages/passport/components/PassportClip.vue @@ -6,6 +6,7 @@ import { whenDefined } from '@devprotocol/util-ts' import Skeleton from '@components/Global/Skeleton.vue' import type { AssetDocument } from '@fixtures/api/assets/schema' import { decode, markdownToHtml } from '@devprotocol/clubs-core' +import {itemToHash} from '@fixtures/router/passportItem' import ImageCard from './ImageCard.vue' import { loadImage, ABI_NFT } from '../utils' @@ -13,6 +14,8 @@ import type { ImageData, PassportClip } from '../types' const props = defineProps<{ item: PassportClip + id: string + index: number }>() const clubConfig = ref() @@ -49,7 +52,7 @@ const shareClip = () => { // please replace the title and text with the actual values title: props.item.description, text: props.item.description, - url: window.location.href, + url: window.location.href+`#${itemToHash(`clips`, props.index)}`, }) } diff --git a/src/pages/passport/components/PassportClips.vue b/src/pages/passport/components/PassportClips.vue index 1733c49f8..3b8c74531 100644 --- a/src/pages/passport/components/PassportClips.vue +++ b/src/pages/passport/components/PassportClips.vue @@ -7,7 +7,10 @@ import ImageCard from './ImageCard.vue' import type { PassportClip } from '../types' import PassportClipCard from './PassportClip.vue' -const props = defineProps<{ clips: PassportClip[] }>() +const props = defineProps<{ + clips: PassportClip[], + id: string, +}>() const i18nBase = i18nFactory(Strings) @@ -21,8 +24,8 @@ onMounted(async () => {