Add any types for getContext data
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
|
||||
export let isOver: boolean = false
|
||||
|
||||
const { settings: { switcher_links } } = getContext('global')
|
||||
const { settings: { switcher_links }}: any = getContext('global')
|
||||
|
||||
let switcherEl: HTMLElement
|
||||
let isOpen = false
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
$: globeResolution = innerWidth > 1440 && window.devicePixelRatio > 1 ? '4k' : '2k'
|
||||
|
||||
const { continents, locations } = getContext('global')
|
||||
const { continents, locations }: any = getContext('global')
|
||||
const randomContinent: any = getRandomItem(continents.filter((cont: any) => cont.countries))
|
||||
const markers = locations.map(({ name, slug, country, globe_close: isClose, coordinates: { coordinates }}: any) => ({
|
||||
name,
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
$: globeResolution = innerWidth > 1440 && window.devicePixelRatio > 1 ? '4k' : '2k'
|
||||
|
||||
const { continents, locations } = getContext('global')
|
||||
const { continents, locations }: any = getContext('global')
|
||||
const randomContinent: any = getRandomItem(continents)
|
||||
const markers = locations.map(({ name, slug, country, coordinates: { coordinates }}): Marker => ({
|
||||
name,
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
export let locations: any[]
|
||||
|
||||
const { continents, settings: { explore_list }} = getContext('global')
|
||||
const { continents, settings: { explore_list }}: any = getContext('global')
|
||||
|
||||
// Continents filtering logic
|
||||
let currentContinent: string = undefined
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
let currentSlide = 0
|
||||
let carouselDots = []
|
||||
|
||||
const { shopProducts } = getContext('shop')
|
||||
const { shopProducts }: any = getContext('shop')
|
||||
|
||||
|
||||
/** Navigate to specific slide */
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
export let product: any = undefined
|
||||
|
||||
const { shop, shopLocations } = getContext('shop')
|
||||
const { shop, shopLocations }: any = getContext('shop')
|
||||
|
||||
let navObserver: IntersectionObserver
|
||||
let introEl: HTMLElement
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import Button from '$components/atoms/Button.svelte'
|
||||
import Image from '$components/atoms/Image.svelte'
|
||||
|
||||
const { locations, shop } = getContext('global')
|
||||
const { locations, shop }: any = getContext('global')
|
||||
const locationsWithPoster = locations
|
||||
// Filter locations with posters only
|
||||
.filter((loc: Location) => loc.has_poster)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import { navigating } from '$app/stores'
|
||||
import { onMount, afterUpdate } from 'svelte'
|
||||
import type { PageData } from './$types'
|
||||
import { scroll, animate, inView, type ScrollOptions, timeline, stagger } from 'motion'
|
||||
import { scroll, animate, inView, type ScrollOptions, timeline } from 'motion'
|
||||
import { map } from '$utils/functions'
|
||||
import { getAssetUrlKey } from '$utils/api'
|
||||
import { DELAY } from '$utils/contants'
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import ShopHeader from '$components/organisms/ShopHeader.svelte'
|
||||
import PostersGrid from '$components/organisms/PostersGrid.svelte'
|
||||
|
||||
const { posters } = getContext('shop')
|
||||
const { posters }: any = getContext('shop')
|
||||
const errors = {
|
||||
404: {
|
||||
title: 'Product not found',
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
|
||||
export let data: PageData
|
||||
|
||||
const { product, shopProduct } = data
|
||||
const { posters } = getContext('shop')
|
||||
const { product, shopProduct }: { product: any, shopProduct: any } = data
|
||||
const { posters }: any = getContext('shop')
|
||||
|
||||
// Update current random product slug
|
||||
$shopCurrentProductSlug = product.location.slug
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
export let data: PageData
|
||||
|
||||
const { posters } = getContext('shop')
|
||||
const { posters }: any = getContext('shop')
|
||||
|
||||
$shopCurrentProductSlug = data.product.location.slug
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user