Skip to content

Commit aab7ee0

Browse files
committed
add jobboard to sponsor detail
1 parent c032d39 commit aab7ee0

File tree

2 files changed

+52
-2
lines changed

2 files changed

+52
-2
lines changed

apps/web/app/composables/useSupabase.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@ import type { FormSpeaker, FormSponsor, FormAttendee, FormStaff, FormJob } from
66
export function useSupabase() {
77
const client = useSupabaseClient<Database>()
88

9-
async function fetchData(table: Table, options?: { id?: string; detailPageId?: string }) {
9+
async function fetchData(table: Table, options?: { id?: string; detailPageId?: string; sponsorId?: string }) {
1010
if (options?.id) {
1111
return await client.from(table).select().eq('id', options.id)
1212
}
1313
if (options?.detailPageId) {
1414
return await client.from(table).select().eq('detail_page_id', options.detailPageId)
1515
}
16+
if (options?.sponsorId) {
17+
return await client.from(table).select().eq('sponsor_id', options.sponsorId)
18+
}
1619
return await client.from(table).select()
1720
}
1821

apps/web/app/pages/sponsors/[id]/index.vue

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
22
import { createError, useAsyncData, useHead, useRoute, useSponsor } from '#imports'
3-
import type { Speaker, Sponsor } from '@vuejs-jp/model'
3+
import type { Job, Speaker, Sponsor } from '@vuejs-jp/model'
44
import { useLocaleCurrent } from '~/composables/useLocaleCurrent'
55
import { useSupabase } from '~/composables/useSupabase'
66
import { conferenceTitle, linkUrl, ogSponsorDescription } from '~/utils/constants'
@@ -28,6 +28,12 @@ const { data: speakers } = await useAsyncData('speakers', async () => {
2828
2929
const speakerData = speakers.value?.data as Speaker[]
3030
31+
const { data: jobs } = await useAsyncData('jobs', async () => {
32+
return await fetchData('jobs', { sponsorId: sponsorData[0].id })
33+
})
34+
35+
const jobData = jobs.value?.data as Job[]
36+
3137
const currentLocale = useLocaleCurrent().locale
3238
const { color, borderColor } = useSponsor()
3339
@@ -84,6 +90,9 @@ useHead({
8490
</div>
8591

8692
<div v-if="sponsorData[0].speaker_id" class="detailbody-persons">
93+
<h3 class="sponsor-subtitle">
94+
{{ `${sponsorData[0].name}のスポンサーセッション` }}
95+
</h3>
8796
<VFSpeaker
8897
:image="speakerData[0].image_url"
8998
:company="currentLocale === 'en' ? speakerData[0].caption_en : speakerData[0].caption_ja"
@@ -97,6 +106,15 @@ useHead({
97106
</div>
98107
</div>
99108

109+
<div v-if="jobData.length !== 0" class="detailbody-jobboard">
110+
<h3 class="sponsor-subtitle">
111+
{{ `${sponsorData[0].name}のジョブボード` }}
112+
</h3>
113+
<nuxt-link :to="jobData[0].link_url" target="_blank">
114+
<img :src="jobData[0].image_url" :alt="jobData[0].image_alt" />
115+
</nuxt-link>
116+
</div>
117+
100118
<div class="back">
101119
<VFLinkButton
102120
class="back-action"
@@ -173,6 +191,7 @@ useHead({
173191
margin-top: calc(var(--unit) * 4);
174192
color: #292C33;
175193
gap: calc(var(--unit) * 5);
194+
padding: calc(var(--unit) * 2.5) 0 calc(var(--unit) * 5);
176195
}
177196
178197
.detailhead-body ::v-deep(a) {
@@ -245,11 +264,25 @@ useHead({
245264
}
246265
}
247266
267+
.sponsor-subtitle {
268+
--sponsor-subtitle-font-size: 2rem;
269+
--sponsor-subtitle-font-weight: 700;
270+
271+
font-size: var(--sponsor-subtitle-font-size);
272+
font-weight: var(--sponsor-subtitle-font-weight);
273+
line-height: normal;
274+
background: var(--color-vue-green-gradation);
275+
background-clip: text;
276+
color: transparent;
277+
}
278+
248279
.detailbody-persons {
249280
font-size: 18px;
250281
display: grid;
251282
grid-template-columns: auto 1fr;
252283
gap: calc(var(--unit) * 4);
284+
padding: calc(var(--unit) * 5) 0;
285+
border-top: 1px solid rgba(0, 0, 0, 0.2);
253286
}
254287
255288
.detailbody-persons ::v-deep(img) {
@@ -278,6 +311,20 @@ useHead({
278311
transition: 0.2s;
279312
}
280313
314+
.detailbody-jobboard {
315+
display: grid;
316+
gap: calc(var(--unit) * 2.5);
317+
padding: calc(var(--unit) * 5) 0;
318+
border-top: 1px solid rgba(0, 0, 0, 0.2);
319+
}
320+
321+
.detailbody-jobboard ::v-deep(a) {
322+
width: 460px;
323+
324+
@media(--mobile) {
325+
width: 100%;
326+
}
327+
}
281328
282329
.back {
283330
margin: 40px auto 0;

0 commit comments

Comments
 (0)