Cleanup Photos page code

This commit is contained in:
2021-10-24 15:30:06 +02:00
parent fd04d98463
commit 726aa60a06

View File

@@ -7,7 +7,6 @@
import { quartOut } from 'svelte/easing'
import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime.js'
import { getAssetUrlKey } from '$utils/helpers'
import { map, lerp, throttle } from '$utils/functions'
// Components
import Metas from '$components/Metas.svelte'
@@ -33,7 +32,10 @@
let scrollY: number
let innerWidth: number, innerHeight: number
// Filters
/**
* Filters
*/
const urlFiltersParams = new URLSearchParams()
let filtered: boolean
let filterCountry: any = $page.query.get('country') || defaultCountry
@@ -68,7 +70,7 @@
/**
* Define URL params
* Handle URL query params
*/
$: countryFlagId = currentCountry ? currentCountry.flag.id : undefined
@@ -103,7 +105,7 @@
/**
* Select change events
* Filters change events
*/
// Country select
const handleCountryChange = ({ detail: value }) => {
@@ -126,7 +128,7 @@
* Load photos
*/
// [function] Load photos helper
const loadPhotos = async (page?: number) => {
const loadPhotos = async (page: number) => {
const res = fetchAPI(`
query {
photos: photo (