From a1c7866f87872e83e7766f76eae443fd5af59fd7 Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Mon, 15 Aug 2022 20:46:13 +0200 Subject: styling of next/prev buttons --- web/pw-server/src/routes/matches/index.svelte | 51 ++++++++++++++++++++------- 1 file changed, 39 insertions(+), 12 deletions(-) (limited to 'web/pw-server/src/routes/matches') diff --git a/web/pw-server/src/routes/matches/index.svelte b/web/pw-server/src/routes/matches/index.svelte index 393d513..8de375b 100644 --- a/web/pw-server/src/routes/matches/index.svelte +++ b/web/pw-server/src/routes/matches/index.svelte @@ -70,40 +70,67 @@ return `?${params}`; } - async function loadNewer() { + function olderMatchesLink(matches: object[]): string { if (matches.length == 0) { - return; + return null; } - const firstTimestamp = matches[0]["timestamp"]; - goto(pageLink({ after: firstTimestamp })); + const lastTimestamp = matches[matches.length - 1]["timestamp"]; + return pageLink({ before: lastTimestamp }); } - async function loadOlder() { + function newerMatchesLink(matches: object[]): string { if (matches.length == 0) { - return; + return null; } - const lastTimestamp = matches[matches.length - 1]["timestamp"]; - goto(pageLink({ before: lastTimestamp })); + const firstTimestamp = matches[0]["timestamp"]; + return pageLink({ after: firstTimestamp }); }
- - +
+ newer + older +
-- cgit v1.2.3