Add regional labels to Splatfest boxes

This commit is contained in:
Slushie 2023-11-10 13:32:28 +00:00
parent ce6996cbc0
commit 7b02be63ef
No known key found for this signature in database
GPG Key ID: CDA11820691304E3

View File

@ -3,6 +3,7 @@
<div class="space-y-2">
<div class="font-splatoon1 text-2xl xl:text-3xl text-shadow mx-2">
{{ $t(title) }}
{{ regions.length < 4 ? ` (${regions.join('/')})` : '' }}
</div>
<div class="flex justify-center mx-2">
@ -41,12 +42,37 @@ import { computed } from 'vue';
import ProductContainer from './ProductContainer.vue';
import { STATUS_PAST, STATUS_ACTIVE, STATUS_UPCOMING } from '@/stores/splatfests';
import SquidTape from './SquidTape.vue';
import { useUSSplatfestsStore, useEUSplatfestsStore, useJPSplatfestsStore, useAPSplatfestsStore } from '@/stores/splatfests';
const props = defineProps({
festival: Object,
historyMode: Boolean,
});
const usSplatfests = useUSSplatfestsStore();
const euSplatfests = useEUSplatfestsStore();
const jpSplatfests = useJPSplatfestsStore();
const apSplatfests = useAPSplatfestsStore();
const regions = computed(() => {
const availableRegions = [];
const id = props.festival.__splatoon3ink_id;
if (usSplatfests.festivals.map(f => f.__splatoon3ink_id).includes(id)) {
availableRegions.push('NA');
}
if (euSplatfests.festivals.map(f => f.__splatoon3ink_id).includes(id)) {
availableRegions.push('EU');
}
if (jpSplatfests.festivals.map(f => f.__splatoon3ink_id).includes(id)) {
availableRegions.push('JP');
}
if (apSplatfests.festivals.map(f => f.__splatoon3ink_id).includes(id)) {
availableRegions.push('AP');
}
return availableRegions;
})
const title = computed(() => {
if (props.historyMode) {
return 'festival.active';