Rework API calls and each loops

This commit is contained in:
2020-03-16 12:57:53 +01:00
parent ba5d1de780
commit 9965c9dec3
6 changed files with 36 additions and 17 deletions

View File

@@ -69,13 +69,13 @@
<div class="wrap">
<div class="globe__pins">
{#if type !== 'part'}
{#each $locations as location}
<div class="pin pin--place" data-lat="{location.coordinates.lat}" data-lng="{location.coordinates.lng}">
<a href="/location/{location.country.slug}/{location.slug}" class="pin__dot" rel="prefetch">
{#each $locations as { name, slug, coordinates, country }}
<div class="pin pin--place" data-lat="{coordinates.lat}" data-lng="{coordinates.lng}">
<a href="/location/{country.slug}/{slug}" class="pin__dot" rel="prefetch">
<i class="pin__dot"></i>
</a>
<a href="/location/{location.country.slug}/{location.slug}" class="pin__name" rel="prefetch">
<span>{location.name}</span>
<a href="/location/{country.slug}/{slug}" class="pin__name" rel="prefetch">
<span>{name}</span>
</a>
</div>
{/each}