Cleanup code
- Remove unused props - Add alt to icon on BoxCTA
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
|
||||
export let location: any
|
||||
export let photos: any[]
|
||||
export let lastUpdated: string
|
||||
export let totalPhotos: number
|
||||
|
||||
dayjs.extend(advancedFormat)
|
||||
@@ -289,7 +288,6 @@
|
||||
location: data.location[0],
|
||||
photos: data.photos,
|
||||
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 Heading from '$components/molecules/Heading.svelte'
|
||||
|
||||
export let photos: any
|
||||
|
||||
const { locations }: any = getContext('global')
|
||||
</script>
|
||||
|
||||
@@ -35,30 +33,4 @@
|
||||
<Newsletter />
|
||||
</div>
|
||||
</section>
|
||||
</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>
|
||||
</main>
|
||||
Reference in New Issue
Block a user