feat(frontend): start settings
This commit is contained in:
parent
0c78cd25b0
commit
c179669799
13 changed files with 301 additions and 17 deletions
|
@ -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"}
|
||||
/>
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue