Cleanup Photos page code
This commit is contained in:
@@ -7,7 +7,6 @@
|
|||||||
import { quartOut } from 'svelte/easing'
|
import { quartOut } from 'svelte/easing'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import relativeTime from 'dayjs/plugin/relativeTime.js'
|
import relativeTime from 'dayjs/plugin/relativeTime.js'
|
||||||
import { getAssetUrlKey } from '$utils/helpers'
|
|
||||||
import { map, lerp, throttle } from '$utils/functions'
|
import { map, lerp, throttle } from '$utils/functions'
|
||||||
// Components
|
// Components
|
||||||
import Metas from '$components/Metas.svelte'
|
import Metas from '$components/Metas.svelte'
|
||||||
@@ -33,7 +32,10 @@
|
|||||||
let scrollY: number
|
let scrollY: number
|
||||||
let innerWidth: number, innerHeight: number
|
let innerWidth: number, innerHeight: number
|
||||||
|
|
||||||
// Filters
|
|
||||||
|
/**
|
||||||
|
* Filters
|
||||||
|
*/
|
||||||
const urlFiltersParams = new URLSearchParams()
|
const urlFiltersParams = new URLSearchParams()
|
||||||
let filtered: boolean
|
let filtered: boolean
|
||||||
let filterCountry: any = $page.query.get('country') || defaultCountry
|
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
|
$: countryFlagId = currentCountry ? currentCountry.flag.id : undefined
|
||||||
|
|
||||||
@@ -103,7 +105,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Select change events
|
* Filters change events
|
||||||
*/
|
*/
|
||||||
// Country select
|
// Country select
|
||||||
const handleCountryChange = ({ detail: value }) => {
|
const handleCountryChange = ({ detail: value }) => {
|
||||||
@@ -126,7 +128,7 @@
|
|||||||
* Load photos
|
* Load photos
|
||||||
*/
|
*/
|
||||||
// [function] Load photos helper
|
// [function] Load photos helper
|
||||||
const loadPhotos = async (page?: number) => {
|
const loadPhotos = async (page: number) => {
|
||||||
const res = fetchAPI(`
|
const res = fetchAPI(`
|
||||||
query {
|
query {
|
||||||
photos: photo (
|
photos: photo (
|
||||||
|
|||||||
Reference in New Issue
Block a user