From bb8a67a82a5f3139156f717dbb5062157d611b09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Pe=CC=81ault?= Date: Fri, 24 Sep 2021 11:03:08 +0200 Subject: [PATCH] Setup some components --- src/components/atoms/Button.svelte | 10 ++++++++++ src/components/molecules/Location.svelte | 15 +++++++++++++-- src/components/organisms/Locations.svelte | 8 ++++---- src/routes/__layout.svelte | 10 +++++++++- src/routes/index.svelte | 1 - src/routes/location/[country]/[location].svelte | 1 + 6 files changed, 37 insertions(+), 8 deletions(-) create mode 100644 src/components/atoms/Button.svelte create mode 100644 src/routes/location/[country]/[location].svelte diff --git a/src/components/atoms/Button.svelte b/src/components/atoms/Button.svelte new file mode 100644 index 0000000..215464f --- /dev/null +++ b/src/components/atoms/Button.svelte @@ -0,0 +1,10 @@ + + +{#if tag === 'button'} + +{/if} \ No newline at end of file diff --git a/src/components/molecules/Location.svelte b/src/components/molecules/Location.svelte index b8c4994..614e446 100644 --- a/src/components/molecules/Location.svelte +++ b/src/components/molecules/Location.svelte @@ -1,3 +1,14 @@ \ No newline at end of file + export let location: any + + const { name, slug, country, last_updated } = location + + +
+ + Flag of {country.name} +

+ {name} +

+
+
\ No newline at end of file diff --git a/src/components/organisms/Locations.svelte b/src/components/organisms/Locations.svelte index 16fbd9d..ce365f0 100644 --- a/src/components/organisms/Locations.svelte +++ b/src/components/organisms/Locations.svelte @@ -1,9 +1,9 @@ -
@@ -13,12 +13,12 @@
- {#each locations as location (location.id)} + {#each locations as location (location.slug)} diff --git a/src/routes/__layout.svelte b/src/routes/__layout.svelte index 59af724..bce8595 100644 --- a/src/routes/__layout.svelte +++ b/src/routes/__layout.svelte @@ -24,13 +24,21 @@ name slug country { - id + name + slug + flag { + id + } } + date_updated } country { name slug + flag { + id + } } continent { diff --git a/src/routes/index.svelte b/src/routes/index.svelte index 29140fa..f36c60b 100644 --- a/src/routes/index.svelte +++ b/src/routes/index.svelte @@ -5,7 +5,6 @@ import Locations from '$components/organisms/Locations.svelte' const globalData: any = getContext('global') - console.log(globalData) Hello location \ No newline at end of file