diff --git a/src/components/molecules/PhotoCard.svelte b/src/components/molecules/PhotoCard.svelte index 09ce3f1..3156e11 100644 --- a/src/components/molecules/PhotoCard.svelte +++ b/src/components/molecules/PhotoCard.svelte @@ -3,17 +3,31 @@ export let id: string export let alt: string + export let url: string = undefined + + const sizes = { + small: { width: 224 }, + medium: { width: 464 }, + large: { width: 864 }, + }
- {alt} + {#if url} + + {alt} + + {:else} + {alt} + {/if}
\ No newline at end of file diff --git a/src/routes/index.svelte b/src/routes/index.svelte index 6607175..098ac5d 100644 --- a/src/routes/index.svelte +++ b/src/routes/index.svelte @@ -40,8 +40,12 @@
- {#each photos as { image: { id, title } }} - + {#each photos as { slug, location: { slug: locationSlug, country }, image: { id, title } }} + {/each}
@@ -96,6 +100,11 @@ const res = await fetchAPI(` query { photo (limit: 11, sort: ["-date_created"]) { + slug + location { + slug + country { slug } + } image { id title