From ee851f2cfa50d2e99ad9433ead27e9297d1046c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Pe=CC=81ault?= Date: Tue, 12 Oct 2021 00:17:04 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20Make=20Photos=20page=20completel?= =?UTF-8?q?y=20dynamic=20with=20filters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - The page now reacts properly with default Select options (`default` was used to set current instead of `selected`) - Make `filtered` variable reactive from filterCountry/filterSort - Reset link goes to parameters and not just `/photos` - Show latest updated date from first photo of the `photos` data - Display the total of photo depending on the country (calculated from `__layout`) --- src/routes/photos.svelte | 109 ++++++++++++++++++++------------------- 1 file changed, 57 insertions(+), 52 deletions(-) diff --git a/src/routes/photos.svelte b/src/routes/photos.svelte index cd14d86..9344710 100644 --- a/src/routes/photos.svelte +++ b/src/routes/photos.svelte @@ -1,5 +1,6 @@ ({ value: slug, name, - default: filterCountry === slug, + selected: filterCountry === slug, })) ]} on:change={handleCountryChange} @@ -199,8 +193,17 @@