Show dynamic locations with a poster on Shop module
This commit is contained in:
@@ -1,6 +1,13 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { getContext } from 'svelte'
|
||||||
// Components
|
// Components
|
||||||
import Button from '$components/atoms/Button.svelte'
|
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>
|
</script>
|
||||||
|
|
||||||
<div class="shop shadow-box-dark">
|
<div class="shop shadow-box-dark">
|
||||||
@@ -16,7 +23,9 @@
|
|||||||
text="Shop"
|
text="Shop"
|
||||||
url="/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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -46,6 +46,7 @@
|
|||||||
title
|
title
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
has_poster
|
||||||
}
|
}
|
||||||
|
|
||||||
country (filter: { status: { _eq: "published" }}) {
|
country (filter: { status: { _eq: "published" }}) {
|
||||||
|
|||||||
Reference in New Issue
Block a user