From cd2b2347289ee730652788e12f9f16c3645a93f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Pe=CC=81ault?= Date: Tue, 12 Oct 2021 00:05:19 +0200 Subject: [PATCH] Rename global data arrays as plural by default Easier for each loop and maps as to use singular --- .../organisms/InteractiveGlobe.svelte | 8 ++--- src/components/organisms/Locations.svelte | 4 +-- src/components/organisms/Shop.svelte | 4 +-- src/routes/__layout.svelte | 29 ++++++++----------- src/routes/index.svelte | 6 ++-- src/routes/locations.svelte | 7 ++--- src/routes/photos.svelte | 2 +- 7 files changed, 25 insertions(+), 35 deletions(-) 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 @@