Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat-add an independent page for sponsors #437

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions i18n/about/sponsor.i18n.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { genI18nMessages } from '~/utils/i18n.utils'

export default genI18nMessages({
'en-us': {
title: 'Sponsor',
og: {
title: 'Sponsor',
description: 'Sponsor of PyCon APAC 2023',
},
},
'zh-hant': {
title: '贊助夥伴',
og: {
title: '贊助夥伴',
description: 'PyCon APAC 2023 贊助夥伴',
},
},
})
58 changes: 58 additions & 0 deletions layouts/ccip.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<template>
<div class="default-layout">
<div class="default-layout__body">
<Nuxt />
<core-footer />
</div>
</div>
</template>

<script>
export default {
components: {},
data() {
return {}
},
head() {
return {}
},
}
</script>

<style>
html {
@apply bg-black-900 font-sans text-primary-100;
font-size: 20px;
word-spacing: 1px;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
box-sizing: border-box;
}

*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
}

.default-layout__body {
display: grid;
grid-template-columns: 100%;
}

body.modal-open {
overflow: hidden;
}

.page-enter-active,
.page-leave-active {
transition: 0.3s;
}
.page-enter,
.page-leave-to {
opacity: 0;
}
</style>
97 changes: 97 additions & 0 deletions pages/about/sponsor.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<template>
<i18n-page-wrapper>
<core-h1 :title="$t('title')"></core-h1>
<div>
<div
v-if="showIndexSponsorSection"
id="sponsor"
class="lg:w-full; pt-12 lg:mx-auto"
>
<sponsor-card-collection
v-for="(leveledSponsors, i) in sponsorsData"
:key="`index_sponsor_level_${i}`"
v-slot="slotProps"
:level-name="leveledSponsors.level_name"
>
<sponsor-card
v-for="(sponsor, j) in leveledSponsors.sponsors"
:key="`index_sponsor_level_${i}_sponsor_${j}`"
:class="slotProps.className"
:sponsor-name="sponsor.name_en_us"
:logo-url="sponsor.logo_url"
:tag="getAttributeByLocale(sponsor, 'subtitle')"
@click.native="showModal(sponsor)"
>
</sponsor-card>
</sponsor-card-collection>
</div>
</div>
<transition name="fade">
<modal
v-if="isOpened"
v-model="isOpened"
:img-urls="selectedSponsor.logo_url"
:img-bg="true"
:name="getAttributeByLocale(selectedSponsor, 'name')"
:intro="getAttributeByLocale(selectedSponsor, 'intro')"
:website-url="selectedSponsor.website_url"
/>
</transition>
</i18n-page-wrapper>
</template>

<script>
import { mapState } from 'vuex'
import I18nPageWrapper from '@/components/core/i18n/PageWrapper'
import CoreH1 from '@/components/core/titles/H1'
import i18n from '@/i18n/about/sponsor.i18n'
import SponsorCard from '@/components/sponsors/SponsorCard'
import SponsorCardCollection from '@/components/sponsors/SponsorCardCollection'

export default {
layout(context) {
const ccip = context.query.ccip // to determine if it's opass mobile app
return ccip ? 'ccip' : 'default'
},
i18n,
name: 'PageSponsor',
components: {
I18nPageWrapper,
CoreH1,
SponsorCard,
SponsorCardCollection,
},
data() {
return {
isOpened: false,
selectedSponsor: {},
}
},
computed: {
...mapState(['sponsorsData']),
isBulleted() {
if (process.client) {
const width = window.innerWidth
if (width < 768) {
return false
}
}
return true
},
showIndexSponsorSection() {
return this.$store.state.configs.showIndexSponsorSection
},
},
created() {
this.$store.dispatch('$getSponsorsData')
},
methods: {
showModal(sponsor) {
this.isOpened = true
this.selectedSponsor = sponsor
},
},
}
</script>

<style lang="postcss" scoped></style>
Loading