Show dynamic locations with a poster on Shop module

This commit is contained in:
2021-10-09 16:49:24 +02:00
parent 5cbd0d25f8
commit 5e790ad68c
2 changed files with 11 additions and 1 deletions

View File

@@ -1,6 +1,13 @@
<script lang="ts">
import { getContext } from 'svelte'
// Components
import Button from '$components/atoms/Button.svelte'
const { location } = getContext('global')
const locationsWithPoster = location
.filter((loc: any) => loc.has_poster)
.map((loc: any) => loc.name)
</script>
<div class="shop shadow-box-dark">
@@ -16,7 +23,9 @@
text="Shop"
url="/shop"
/>
<p class="detail">Posters available for Melbourne, Brisbane, Montpellier and Bordeaux.</p>
<p class="detail">
Posters available for {locationsWithPoster.join(', ').replace(/,(?!.*,)/gmi, ' and')}.
</p>
</div>
</div>
</div>