Skip to content

Commit c80fefb

Browse files
committed
:feat(namecard) add share page
1 parent 06d890c commit c80fefb

File tree

4 files changed

+97
-4
lines changed

4 files changed

+97
-4
lines changed

apps/web/app/composables/useNamecard.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { Status } from '~/components/namecard/CreationStatus.vue'
44
import type { Attendee } from '@vuejs-jp/model'
55

66

7-
export async function useNamecard() {
7+
export async function useNamecard(userId?:string) {
88
const { fetchAttendeeDataByUserId } = useSupabase()
99
const { getUser } = useAuth()
1010

@@ -13,7 +13,7 @@ export async function useNamecard() {
1313
})
1414

1515
const { data: attendeeByUserId } = await useAsyncData('attendeeByUserId', async () => {
16-
return await fetchAttendeeDataByUserId('attendees', authUserId.value ?? '')
16+
return await fetchAttendeeDataByUserId('attendees', authUserId.value ?? userId ?? '')
1717
})
1818

1919
const userData = computed(() => {

apps/web/app/lang/en.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
"not_found": "The page you are looking for cannot be found.",
77
"prefix_year": "",
88
"suffix_year": "2024",
9+
"invite_vue_fes": "Would you like to join Vue Fes Japan 2024 as well?",
10+
"share_namecard": "Let's share this name card on social media!",
11+
"official_site": "Vue Fes Japan Official Website",
912
"top_page": {
1013
"latest_information": "Get the latest information on our official social media",
1114
"date": "October 19th, 2024",

apps/web/app/lang/ja.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
"not_found": "お探しのページが見つかりません。",
77
"prefix_year": "2024",
88
"suffix_year": "",
9+
"invite_vue_fes": "あなたもVue Fes Japan 2024に参加しませんか?",
10+
"share_namecard": "このネームカードをSNSでシェアしよう!",
11+
"official_site": "Vue Fes Japan 2024公式サイト",
912
"day_of_week": {
1013
"sunday": "",
1114
"monday": "",
Lines changed: 89 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,89 @@
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

Comments
 (0)