Cleanup code

- Remove unused props
- Add alt to icon on BoxCTA
This commit is contained in:
2021-11-14 19:56:11 +01:00
parent 8dd59e74d4
commit c9c028118b
4 changed files with 2 additions and 33 deletions

View File

@@ -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,
}
}
}

View File

@@ -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>