feat: paginate member list, add create member button

This commit is contained in:
Sam 2023-03-14 16:43:31 +01:00
parent 9bfabcc1f1
commit 3678f5a3e8
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
6 changed files with 120 additions and 34 deletions

View file

@ -2,6 +2,7 @@
import { goto } from "$app/navigation";
import { type MeUser, userAvatars, type APIError, MAX_MEMBERS } from "$lib/api/entities";
import { apiFetchClient } from "$lib/api/fetch";
import ErrorAlert from "$lib/components/ErrorAlert.svelte";
import FallbackImage from "$lib/components/FallbackImage.svelte";
import { userStore } from "$lib/store";
import {
@ -77,10 +78,7 @@
</p>
{/if}
{#if error}
<Alert color="danger" fade={false}>
<h5 class="alert-heading">An error occurred</h5>
<b>{error.code}</b>: {error.message}
</Alert>
<ErrorAlert {error} />
{/if}
</div>
<div class="col-lg-4">
@ -137,10 +135,7 @@
<input type="text" class="form-control" bind:value={deleteUsername} />
</p>
{#if deleteError}
<Alert color="danger" fade={false}>
<h5 class="alert-heading">An error occurred</h5>
<b>{deleteError.code}</b>: {deleteError.message}
</Alert>
<ErrorAlert error={deleteError} />
{/if}
</ModalBody>
<ModalFooter>

View file

@ -1,6 +1,7 @@
<script lang="ts">
import type { APIError, Invite } from "$lib/api/entities";
import { apiFetchClient } from "$lib/api/fetch";
import ErrorAlert from "$lib/components/ErrorAlert.svelte";
import { Alert, Button, Modal, Table } from "sveltestrap";
import type { PageData } from "./$types";
@ -54,10 +55,7 @@
</div>
<div class="col-md">
{#if error}
<Alert color="danger" fade={false}>
<h4 class="alert-heading">An error occurred</h4>
<b>{error.code}</b>: {error.message}
</Alert>
<ErrorAlert {error} />
{/if}
</div>
</div>