diff --git a/src/components/organisms/InteractiveGlobe.svelte b/src/components/organisms/InteractiveGlobe.svelte
index 04790aa..6dc63de 100644
--- a/src/components/organisms/InteractiveGlobe.svelte
+++ b/src/components/organisms/InteractiveGlobe.svelte
@@ -7,7 +7,7 @@
export let scrollSmooth: number = 0.5
export let opacity: number = 1
- const { continent, location } = getContext('global')
+ const { continents, locations } = getContext('global')
let globe: any
let Globe: any
@@ -16,9 +16,9 @@
let containerTop: number = 0, containerHeight: number = 0
let observer: IntersectionObserver
- const randomContinent = getRandomElement(continent.filter(cont => cont.countries))
+ const randomContinent = getRandomElement(continents.filter(cont => cont.countries))
const globeResolution = windowWidth > 1440 && window.devicePixelRatio > 1 ? '4k' : '2k'
- const locations = location.map(({ name, slug, country, coordinates: { coordinates }}: any) => ({
+ const markers = locations.map(({ name, slug, country, coordinates: { coordinates }}: any) => ({
name,
slug,
countryName: country.name,
@@ -77,7 +77,7 @@
scrollSmoothing: scrollSmooth,
opacity,
texture: `/images/globe-map-${globeResolution}.png`,
- markers: locations,
+ markers,
onLinkClicked: () => {}
})
diff --git a/src/components/organisms/Locations.svelte b/src/components/organisms/Locations.svelte
index aa72bd0..2eeb484 100644
--- a/src/components/organisms/Locations.svelte
+++ b/src/components/organisms/Locations.svelte
@@ -6,7 +6,7 @@
export let locations: any
- const { continent, settings: { explore_list }} = getContext('global')
+ const { continents, settings: { explore_list }} = getContext('global')
@@ -15,7 +15,7 @@
- {#each continent as { name, slug }}
+ {#each continents as { name, slug }}
-
diff --git a/src/components/organisms/Shop.svelte b/src/components/organisms/Shop.svelte
index 6b5affd..98a26e8 100644
--- a/src/components/organisms/Shop.svelte
+++ b/src/components/organisms/Shop.svelte
@@ -4,9 +4,9 @@
import Button from '$components/atoms/Button.svelte'
import Image from '$components/atoms/Image.svelte'
- const { location, shop } = getContext('global')
+ const { locations, shop } = getContext('global')
- const locationsWithPoster = location
+ const locationsWithPoster = locations
.filter((loc: any) => loc.has_poster)
.map((loc: any) => loc.name)
diff --git a/src/routes/__layout.svelte b/src/routes/__layout.svelte
index 8735c28..39d2d8a 100644
--- a/src/routes/__layout.svelte
+++ b/src/routes/__layout.svelte
@@ -28,16 +28,14 @@
export async function load ({ page, session, fetch, context }) {
const res = await fetchAPI(`
query {
- location (filter: { status: { _eq: "published" }}) {
+ locations: location (filter: { status: { _eq: "published" }}) {
name
slug
coordinates
country {
name
slug
- flag {
- id
- }
+ flag { id }
}
date_updated
photos (sort: "-date_created", limit: ${import.meta.env.VITE_PREVIEW_COUNT}) {
@@ -49,24 +47,18 @@
has_poster
}
- country (filter: { status: { _eq: "published" }}) {
+ countries: country (filter: { status: { _eq: "published" }}) {
name
slug
- flag {
- id
- }
- locations {
- slug
- }
+ flag { id }
+ locations { id slug }
}
- continent {
+ continents: continent {
name
slug
rotation
- countries {
- slug
- }
+ countries { id slug }
}
settings {
@@ -86,7 +78,10 @@
shop {
module_title
module_text
- module_image { id title }
+ module_image {
+ id
+ title
+ }
}
# Count
@@ -111,7 +106,7 @@
props: {
data: {
...data,
- continent: filteredContinents,
+ continents: filteredContinents,
},
count: {
photos: data.photo_aggregated[0].count.id,
diff --git a/src/routes/index.svelte b/src/routes/index.svelte
index e47301c..673cc24 100644
--- a/src/routes/index.svelte
+++ b/src/routes/index.svelte
@@ -15,7 +15,7 @@
export let photos: any
- const { settings, location }: any = getContext('global')
+ const { settings, locations }: any = getContext('global')
const { path } = $page
@@ -75,9 +75,7 @@
World
-
+
diff --git a/src/routes/locations.svelte b/src/routes/locations.svelte
index bddfc6a..541d9de 100644
--- a/src/routes/locations.svelte
+++ b/src/routes/locations.svelte
@@ -10,7 +10,7 @@
export let photos: any
- const { location }: any = getContext('global')
+ const { locations }: any = getContext('global')
-
-
+
diff --git a/src/routes/photos.svelte b/src/routes/photos.svelte
index fdc94ad..aa397a1 100644
--- a/src/routes/photos.svelte
+++ b/src/routes/photos.svelte
@@ -24,7 +24,7 @@
dayjs.extend(relativeTime)
- const { country: countries }: any = getContext('global')
+ const { countries }: any = getContext('global')
let buttonReset: HTMLElement
let buttonShuffle: HTMLElement