feat(frontend): start settings

This commit is contained in:
sam 2024-11-24 17:36:02 +01:00
parent 0c78cd25b0
commit c179669799
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
13 changed files with 301 additions and 17 deletions

View file

@ -1,14 +1,14 @@
<script lang="ts">
import { DEFAULT_AVATAR } from "$lib";
type Props = { url: string | null; alt: string; lazyLoad?: boolean };
let { url, alt, lazyLoad }: Props = $props();
type Props = { url: string | null; alt: string; lazyLoad?: boolean; width?: number };
let { url, alt, lazyLoad, width }: Props = $props();
</script>
<img
class="rounded-circle img-fluid"
src={url || DEFAULT_AVATAR}
{alt}
width={200}
width={width || 200}
loading={lazyLoad ? "lazy" : "eager"}
/>

View file

@ -4,17 +4,19 @@
import { t } from "$lib/i18n";
import KeyedValidationErrors from "./errors/KeyedValidationErrors.svelte";
type Props = { headerElem?: string; error: RawApiError };
let { headerElem, error }: Props = $props();
type Props = { showHeader?: boolean; headerElem?: string; error: RawApiError };
let { showHeader, headerElem, error }: Props = $props();
</script>
<svelte:element this={headerElem ?? "h4"}>
{#if error.code === ErrorCode.BadRequest}
{$t("error.bad-request-header")}
{:else}
{$t("error.generic-header")}
{/if}
</svelte:element>
{#if showHeader !== false}
<svelte:element this={headerElem ?? "h4"}>
{#if error.code === ErrorCode.BadRequest}
{$t("error.bad-request-header")}
{:else}
{$t("error.generic-header")}
{/if}
</svelte:element>
{/if}
<p>{errorDescription($t, error.code)}</p>
{#if error.errors}
<details>