|
1 |
| -<script setup lang="ts"></script> |
2 |
| -<template></template> |
| 1 | +<script setup lang="ts"> |
| 2 | +import { computed } from 'vue' |
| 3 | +import { createError, useHead, useRoute } from '#imports' |
| 4 | +import { useI18n } from '#i18n' |
| 5 | +import { useNamecard } from '~/composables/useNamecard' |
| 6 | +import { conferenceTitle, linkUrl, ogSpeakerDescription } from '~/utils/constants' |
| 7 | +import { generalOg, twitterOg } from '~/utils/og.constants' |
| 8 | +import { useLocaleCurrent } from '~/composables/useLocaleCurrent' |
| 9 | +
|
| 10 | +const { t } = useI18n() |
| 11 | +const route = useRoute() |
| 12 | +const id = route.params.id as string |
| 13 | +const { attendee } = await useNamecard(id) |
| 14 | +if (!attendee) { |
| 15 | + throw createError({ statusCode: 404, statusMessage: 'Attendee not found' }) |
| 16 | +} |
| 17 | +
|
| 18 | +const currentLocale = useLocaleCurrent().locale |
| 19 | +
|
| 20 | +const officialSiteUrl = computed(() => { |
| 21 | + return currentLocale.value === 'ja' ? linkUrl : `${linkUrl}/en` |
| 22 | +}) |
| 23 | +
|
| 24 | +// TODO OGタグの設定 |
| 25 | +useHead({ |
| 26 | + titleTemplate: (titleChunk) => `${conferenceTitle}`, |
| 27 | + meta: [ |
| 28 | + ...generalOg({ |
| 29 | + title: `${conferenceTitle}`, |
| 30 | + description: ogSpeakerDescription, |
| 31 | + url: `${linkUrl}namecard/${id}/share`, |
| 32 | + }), |
| 33 | + ...twitterOg({ |
| 34 | + title: `${conferenceTitle}`, |
| 35 | + description: ogSpeakerDescription, |
| 36 | + url: `${linkUrl}namecard/${id}/share`, |
| 37 | + }), |
| 38 | + ], |
| 39 | +}) |
| 40 | +</script> |
| 41 | +<template> |
| 42 | + <div class="namecard-share-root"> |
| 43 | + <VFOgCard23 class="namecard" :user="attendee" /> |
| 44 | + <VFComment class="invite-comment" :title="t('invite_vue_fes')" /> |
| 45 | + <VFLinkButton |
| 46 | + class="link-button" |
| 47 | + :href="officialSiteUrl" |
| 48 | + background-color="vue-green/200" |
| 49 | + color="white" |
| 50 | + >{{ t('official_site') }}</VFLinkButton |
| 51 | + > |
| 52 | + <VFComment class="share-namecard" :title="t('share_namecard')" /> |
| 53 | + <!-- TODO snsアイコン&リンク設置 --> |
| 54 | + <ul class="sns-list"> |
| 55 | + <li>x</li> |
| 56 | + <li>facebook</li> |
| 57 | + <li>copy</li> |
| 58 | + </ul> |
| 59 | + </div> |
| 60 | +</template> |
| 61 | + |
| 62 | +<style scoped> |
| 63 | +.namecard-share-root { |
| 64 | + --header-height: calc(var(--unit) * 10); |
| 65 | + --content-padding: calc(var(--unit) * 15); |
| 66 | + padding-top: calc(var(--header-height) + var(--content-padding)); |
| 67 | + padding-bottom: var(--content-padding); |
| 68 | + max-width: 960px; |
| 69 | + margin: 0 auto; |
| 70 | +} |
| 71 | +.namecard { |
| 72 | + max-width: 960px; |
| 73 | + margin: 0 auto calc(var(--unit) * 7.5); |
| 74 | +} |
| 75 | +.invite-comment { |
| 76 | + margin: 0 auto calc(var(--unit) * 2.5); |
| 77 | +} |
| 78 | +.link-button { |
| 79 | + --height-button: 66px; |
| 80 | +
|
| 81 | + display: flex; |
| 82 | + justify-content: center; |
| 83 | + align-items: center; |
| 84 | + width: 400px; |
| 85 | + height: var(--height-button); |
| 86 | + border-radius: var(--height-button); |
| 87 | + margin: 0 auto calc(var(--unit) * 7.5); |
| 88 | +} |
| 89 | +</style> |
0 commit comments