fix design for pubnix user count

This commit is contained in:
Akis 2023-02-25 19:17:34 +02:00
parent 0124560e76
commit d7a9153751
Signed by untrusted user: akis
GPG Key ID: 267BF5C6677944ED
3 changed files with 2 additions and 5 deletions

View File

@ -9,7 +9,6 @@ export const load = (async () => {
return { return {
users: get(pubnixUsers), users: get(pubnixUsers),
onlineUserCount: get(pubnixUsers).length,
...meta ...meta
} }
}) satisfies PageServerLoad; }) satisfies PageServerLoad;

View File

@ -37,7 +37,7 @@
{#if !data.users.error} {#if !data.users.error}
{#if data.users.users.some(isOnline)} {#if data.users.users.some(isOnline)}
<p>There are {onlineUserCount} users online out of {userCount} users.</p> <p class="my-4">There are {onlineUserCount} users online out of {userCount} users.</p>
<div class="flex flex-row flex-wrap gap-4"> <div class="flex flex-row flex-wrap gap-4">
{#each data.users.users as user} {#each data.users.users as user}
{#if user.online} {#if user.online}

View File

@ -3,15 +3,13 @@
export let data: PageData; export let data: PageData;
import User from "../User.svelte"; import User from "../User.svelte";
const userCount = data.users.users.length;
</script> </script>
<h1>{data.title}</h1> <h1>{data.title}</h1>
{#if !data.users.error} {#if !data.users.error}
{#if data.users.users.length > 0} {#if data.users.users.length > 0}
<p>There are {userCount} users on the pubnix.</p> <p class="my-4">There are {data.users.users.length} users on the pubnix.</p>
<div class="flex flex-row flex-wrap gap-4"> <div class="flex flex-row flex-wrap gap-4">
{#each data.users.users as user} {#each data.users.users as user}
<User {user} /> <User {user} />