From b6bb849e2cfad081c757ab7892fe02adc1d6b463 Mon Sep 17 00:00:00 2001 From: Julian Lobbes Date: Mon, 22 May 2023 03:12:10 +0200 Subject: [PATCH] feat(frontend): user list pagination --- frontend/src/app.css | 5 + frontend/src/routes/users/+page.svelte | 308 +++++++++++++------------ 2 files changed, 167 insertions(+), 146 deletions(-) diff --git a/frontend/src/app.css b/frontend/src/app.css index a20b537..9f1f5dd 100644 --- a/frontend/src/app.css +++ b/frontend/src/app.css @@ -51,6 +51,11 @@ button:focus { @apply ring-1 ring-neutral-400 ring-offset-1; } + button:disabled { + @apply opacity-25; + @apply bg-neutral-100; + @apply border-2 border-neutral-200; + } table { @apply border-collapse; diff --git a/frontend/src/routes/users/+page.svelte b/frontend/src/routes/users/+page.svelte index a2c72ca..6f7cba4 100644 --- a/frontend/src/routes/users/+page.svelte +++ b/frontend/src/routes/users/+page.svelte @@ -1,11 +1,7 @@ -
-

Users

- {#if loading} -
-

Loading...

-
- {:else if error} - {#if errorMessages.length} - {#each errorMessages as errorMessage} -

{errorMessage}

+ + + + + + + + + + + + + + {#if currentState === 'finished'} + {#each currentItems as user} + + + + + + + + {/each} - {:else} -

An unknown error occurred.

+ {:else if currentState === 'loading'} + + + + {:else if currentState === 'error'} + + {#each errorMessages as message} + + {/each} + {/if} - {:else} -
-
List of users
IDEmailFirst NameLast NameCreatedUpdated
{user.id}{user.email}{user.first_name}{user.last_name}{new Date(user.created).toLocaleDateString()}{new Date(user.updated).toLocaleDateString()}
Loading...
{message}
- - - - - - - - - - - - - {#each currentItems as user} - - - - - - - - - {/each} - -
List of users
IDEmailFirst NameLast NameCreatedUpdated
{user.id}{user.email}{user.first_name}{user.last_name}{new Date(user.created).toLocaleDateString()}{new Date(user.updated).toLocaleDateString()}
-
-
- - - - - -
- {/if} - + + + + + +