Cleanup code
- Remove unused props - Add alt to icon on BoxCTA
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
<a href={url} class="box-cta">
|
<a href={url} class="box-cta">
|
||||||
<div class="icon">
|
<div class="icon">
|
||||||
<Icon icon={icon} />
|
<Icon icon={icon} label={alt} />
|
||||||
</div>
|
</div>
|
||||||
<span class="text-label">
|
<span class="text-label">
|
||||||
{label}
|
{label}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
import Select from '$components/molecules/Select.svelte'
|
import Select from '$components/molecules/Select.svelte'
|
||||||
|
|
||||||
export let item: any
|
export let item: any
|
||||||
export let index: number
|
|
||||||
|
|
||||||
const dispatch = createEventDispatcher()
|
const dispatch = createEventDispatcher()
|
||||||
const quantityLimit = 5
|
const quantityLimit = 5
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
|
|
||||||
export let location: any
|
export let location: any
|
||||||
export let photos: any[]
|
export let photos: any[]
|
||||||
export let lastUpdated: string
|
|
||||||
export let totalPhotos: number
|
export let totalPhotos: number
|
||||||
|
|
||||||
dayjs.extend(advancedFormat)
|
dayjs.extend(advancedFormat)
|
||||||
@@ -289,7 +288,6 @@
|
|||||||
location: data.location[0],
|
location: data.location[0],
|
||||||
photos: data.photos,
|
photos: data.photos,
|
||||||
totalPhotos: data.photos.length ? data.total_published[0].count.location : 0,
|
totalPhotos: data.photos.length ? data.total_published[0].count.location : 0,
|
||||||
lastUpdated: data.photos.length ? data.photos[0].date_created : undefined,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,8 +8,6 @@
|
|||||||
import Newsletter from '$components/organisms/Newsletter.svelte'
|
import Newsletter from '$components/organisms/Newsletter.svelte'
|
||||||
import Heading from '$components/molecules/Heading.svelte'
|
import Heading from '$components/molecules/Heading.svelte'
|
||||||
|
|
||||||
export let photos: any
|
|
||||||
|
|
||||||
const { locations }: any = getContext('global')
|
const { locations }: any = getContext('global')
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -35,30 +33,4 @@
|
|||||||
<Newsletter />
|
<Newsletter />
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
|
||||||
<script context="module" lang="ts">
|
|
||||||
import { fetchAPI } from '$utils/api'
|
|
||||||
|
|
||||||
export async function load ({ page, fetch, session, stuff }) {
|
|
||||||
const res = await fetchAPI(`
|
|
||||||
query {
|
|
||||||
photo (limit: 11, sort: ["-date_created"]) {
|
|
||||||
image {
|
|
||||||
id
|
|
||||||
title
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`)
|
|
||||||
|
|
||||||
const { data } = res
|
|
||||||
|
|
||||||
return {
|
|
||||||
props: {
|
|
||||||
photos: data.photo,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
Reference in New Issue
Block a user