Show dynamic locations with a poster on Shop module
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user