Restructure utility files, Use a bundle.css to fix CSS issues
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -5,10 +5,10 @@
|
||||
continents,
|
||||
countries,
|
||||
locations
|
||||
} from '../store'
|
||||
} from '../utils/store'
|
||||
|
||||
export async function preload (page, session) {
|
||||
const request = await this.fetch(apiEndpoints.gql, {
|
||||
const req = await this.fetch(apiEndpoints.gql, {
|
||||
method: 'post',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ query: `{
|
||||
@@ -54,13 +54,14 @@
|
||||
}
|
||||
}`})
|
||||
})
|
||||
const result = await request.json()
|
||||
|
||||
// Set data into store
|
||||
site.set(result.data.site.data[0])
|
||||
continents.set(result.data.continents.data)
|
||||
countries.set(result.data.countries.data)
|
||||
locations.set(result.data.locations.data)
|
||||
const result = await req.json()
|
||||
if (req.ok) {
|
||||
// Set data into store
|
||||
site.set(result.data.site.data[0])
|
||||
continents.set(result.data.continents.data)
|
||||
countries.set(result.data.countries.data)
|
||||
locations.set(result.data.locations.data)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -82,9 +83,8 @@
|
||||
$locations.forEach(loc => loc.country = $countries.find(cont => cont.id === loc.country.id))
|
||||
</script>
|
||||
|
||||
<!-- <style src="../style/style.scss" global></style> -->
|
||||
<style lang="scss" global>
|
||||
@import "./style/style.scss";
|
||||
@import "../style/style.scss";
|
||||
</style>
|
||||
|
||||
<slot></slot>
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
site,
|
||||
currentLocation,
|
||||
currentPhotos
|
||||
} from '../store'
|
||||
} from '../utils/store'
|
||||
|
||||
// Depencencies
|
||||
import AOS from 'aos'
|
||||
|
||||
// Components
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script>
|
||||
import { onMount } from 'svelte'
|
||||
import { site } from '../store'
|
||||
import { site } from '../utils/store'
|
||||
|
||||
// Dependencies
|
||||
import AOS from 'aos'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script context="module">
|
||||
import {
|
||||
apiEndpoints,
|
||||
} from '../store'
|
||||
} from '../utils/store'
|
||||
|
||||
// Preload data
|
||||
export async function preload (page, session) {
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
<script>
|
||||
import { onMount } from 'svelte'
|
||||
import { site, currentLocation, currentPhotos } from '../store'
|
||||
import * as fn from '../functions'
|
||||
import { site, currentLocation, currentPhotos } from '../utils/store'
|
||||
import * as fn from '../utils/functions'
|
||||
|
||||
// Dependencies
|
||||
import * as basicScroll from 'basicscroll'
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
locations,
|
||||
currentLocation,
|
||||
currentPhotos
|
||||
} from '../../../store'
|
||||
} from '../../../utils/store'
|
||||
import { stores } from '@sapper/app'
|
||||
|
||||
// Preload data
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
<script>
|
||||
import { onMount } from 'svelte'
|
||||
import * as fn from '../../../functions'
|
||||
import * as fn from '../../../utils/functions'
|
||||
const { page } = stores()
|
||||
|
||||
// Dependencies
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
locations,
|
||||
currentLocation,
|
||||
currentPhotos
|
||||
} from '../../../../store'
|
||||
} from '../../../../utils/store'
|
||||
|
||||
// Define either to preload data or use the store
|
||||
let preloaded
|
||||
@@ -32,7 +32,7 @@
|
||||
<script>
|
||||
import { onMount, createEventDispatcher } from 'svelte'
|
||||
import { goto } from '@sapper/app'
|
||||
import * as fn from '../../../../functions'
|
||||
import * as fn from '../../../../utils/functions'
|
||||
const { page } = stores()
|
||||
const dispatch = createEventDispatcher()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user