Create Locations page

This commit is contained in:
2021-10-04 19:44:07 +02:00
parent 9bb57362f0
commit 4691c190bc
3 changed files with 117 additions and 0 deletions

View File

@@ -0,0 +1,67 @@
<script lang="ts">
import { getContext } from 'svelte'
// Components
import Metas from '$components/Metas.svelte'
import InteractiveGlobe from '$components/organisms/InteractiveGlobe.svelte'
import Locations from '$components/organisms/Locations.svelte'
import Shop from '$components/organisms/Shop.svelte'
import Newsletter from '$components/organisms/Newsletter.svelte'
export let photos: any
const { location }: any = getContext('global')
</script>
<Metas
title="Locations"
description=""
image=""
/>
<main class="explore">
<section class="explore__intro">
<h1 class="title-huge">Houses</h1>
<p class="text-medium">Explore the globe to discover unique locations across the world</p>
</section>
<section class="explore__locations" id="locations">
<InteractiveGlobe />
<Locations
locations={location}
/>
</section>
<section class="grid-modules grid">
<div class="wrap">
<Shop />
<Newsletter />
</div>
</section>
</main>
<script context="module" lang="ts">
import { fetchAPI } from '$utils/api'
export async function load ({ page, session, fetch, context }) {
const res = await fetchAPI(`
query {
photo (limit: 11, sort: ["-date_created"]) {
image {
id
title
}
}
}
`)
const { data } = res
return {
props: {
photos: data.photo,
}
}
}
</script>