Add photo's city to Postcard on Photos grid

This commit is contained in:
2021-11-14 19:51:31 +01:00
parent db7307669d
commit cf6afd832e
2 changed files with 4 additions and 3 deletions

View File

@@ -39,7 +39,6 @@
<ul class="postcard__address"> <ul class="postcard__address">
<li>{street}</li> <li>{street}</li>
<li>{location}{region ? `, ${region}` : ''}</li> <li>{location}{region ? `, ${region}` : ''}</li>
<li>{country}</li>
</ul> </ul>
</div> </div>
</div> </div>

View File

@@ -156,6 +156,7 @@
flag { id } flag { id }
} }
} }
city
} }
} }
`) `)
@@ -293,7 +294,7 @@
<div class="grid container"> <div class="grid container">
{#if photos.length} {#if photos.length}
<div class="photos__grid"> <div class="photos__grid">
{#each photos as { image, slug, location, title }, index} {#each photos as { image, slug, location, title, city }, index}
<figure class="photo shadow-photo"> <figure class="photo shadow-photo">
<a href="/{location.country.slug}/{location.slug}/{slug}"> <a href="/{location.country.slug}/{location.slug}/{slug}">
<Image <Image
@@ -311,7 +312,7 @@
<figcaption> <figcaption>
<PostCard <PostCard
street={title} street={title}
location={location.name} location={city ? `${city}, ${location.name}` : location.name}
region={location.region} region={location.region}
country={location.country.name} country={location.country.name}
flagId={location.country.flag.id} flagId={location.country.flag.id}
@@ -400,6 +401,7 @@
flag { id } flag { id }
} }
} }
city
date_created date_created
} }