From 4f24f79931cc9d90969ae3a12a911c211d9d1b31 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sat, 13 Jan 2024 01:22:04 -0800 Subject: feat(user): show banner --- src/routes/user/[user]/+page.svelte | 98 +++++++++++++++++++++++-------------- 1 file changed, 61 insertions(+), 37 deletions(-) (limited to 'src/routes') diff --git a/src/routes/user/[user]/+page.svelte b/src/routes/user/[user]/+page.svelte index c6423754..06b995e7 100644 --- a/src/routes/user/[user]/+page.svelte +++ b/src/routes/user/[user]/+page.svelte @@ -19,7 +19,7 @@ -
+
{#if userData === null} Could not load user profile for - - - - -
-

- @{userData.name} - Badge Wall -

- - {data.username} has watched {(userData.statistics.anime.minutesWatched / 60 / 24).toFixed( - 1 - )} days of anime and read - {estimatedDayReading(userData.statistics.manga.chaptersRead).toFixed(1)} days of manga. - -

- - {data.username} has collected {#await fetch(`/api/badges?id=${userData.id}`)} - ... - {:then badges} - {#await badges.json()} +

+ {#if userData} + + {/if} + +
+ + + + +
+

+ @{userData.name} + + Badge Wall +

+ + {data.username} has watched {(userData.statistics.anime.minutesWatched / 60 / 24).toFixed( + 1 + )} days of anime and read + {estimatedDayReading(userData.statistics.manga.chaptersRead).toFixed(1)} days of manga. + +

+ + {data.username} has collected {#await fetch(`/api/badges?id=${userData.id}`)} ... {:then badges} - {badges.length} + {#await badges.json()} + ... + {:then badges} + {badges.length} + {:catch} + ? + {/await} {:catch} ? {/await} - {:catch} - ? - {/await} - badges using Badge Wall. + badges using Badge Wall. +

{/if}
-- cgit v1.2.3