From b990f944cac5f294b53ae7b942331de85e3b30eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Pe=CC=81ault?= Date: Sat, 22 Aug 2020 19:53:50 +0200 Subject: [PATCH] Add City field to photos Used for regions/wider locations --- src/molecules/Photo.svelte | 6 +- src/routes/_layout.svelte | 60 +------------------- src/routes/location/[country]/[place].svelte | 5 +- src/utils/mainQuery.js | 58 +++++++++++++++++++ 4 files changed, 66 insertions(+), 63 deletions(-) create mode 100644 src/utils/mainQuery.js diff --git a/src/molecules/Photo.svelte b/src/molecules/Photo.svelte index b025aca..4795181 100644 --- a/src/molecules/Photo.svelte +++ b/src/molecules/Photo.svelte @@ -15,9 +15,9 @@ const defaultHeight = Math.ceil(defaultWidth / 1.5) // Location related - const { name, date, location } = photo + const { name, date, location, city } = photo const { private_hash } = photo.image - const imgAlt = `${name}, ${location.region}, ${location.country.name}` + const imgAlt = `${name}, ${city ? city : location.region}, ${location.country.name}` const nameSplit = name.split(', ') // Photo index @@ -44,7 +44,7 @@ {/each} -

{location.region}, {location.country.name}

+

{city ? city : location.region}, {location.country.name}

diff --git a/src/routes/_layout.svelte b/src/routes/_layout.svelte index 4e66a19..9c95d45 100644 --- a/src/routes/_layout.svelte +++ b/src/routes/_layout.svelte @@ -1,4 +1,6 @@