- Added @lucide/svelte as a dependency for icon support in various components. - Updated AboutDialog, AppShell, AuthPage, Header, SettingsDialog, and styles for improved functionality and UI consistency. - Introduced new props and state management for better user experience. - Refactored CSS for cleaner styling and improved layout.
64 lines
1.3 KiB
Svelte
64 lines
1.3 KiB
Svelte
<script lang="ts">
|
|
import type { Snippet } from 'svelte';
|
|
import type { AboutLink } from '../types';
|
|
import Dialog from './Dialog.svelte';
|
|
|
|
let {
|
|
brand = 'Application',
|
|
children,
|
|
description = '',
|
|
icon,
|
|
links = [],
|
|
onClose,
|
|
open = $bindable(false),
|
|
version = ''
|
|
}: {
|
|
brand?: string;
|
|
children?: Snippet;
|
|
description?: string;
|
|
icon?: Snippet;
|
|
links?: AboutLink[];
|
|
onClose?: () => void | Promise<void>;
|
|
open?: boolean;
|
|
version?: string;
|
|
} = $props();
|
|
|
|
let wasOpen = false;
|
|
|
|
$effect(() => {
|
|
if (wasOpen && !open) void onClose?.();
|
|
wasOpen = open;
|
|
});
|
|
</script>
|
|
|
|
<Dialog bind:open title={`About ${brand}`}>
|
|
<div class="sc-auth-brand">
|
|
{#if icon}
|
|
{@render icon()}
|
|
{:else}
|
|
<span aria-hidden="true" class="sc-brand-mark">{brand.slice(0, 1).toUpperCase()}</span>
|
|
{/if}
|
|
<strong>{brand}</strong>
|
|
</div>
|
|
|
|
{#if version}
|
|
<p class="sc-muted">Version {version}</p>
|
|
{/if}
|
|
|
|
{#if description}
|
|
<p class="sc-muted">{description}</p>
|
|
{/if}
|
|
|
|
{#if children}
|
|
{@render children()}
|
|
{/if}
|
|
|
|
{#if links.length > 0}
|
|
<div class="sc-about-links">
|
|
{#each links as link}
|
|
<a href={link.href} rel="noreferrer" target="_blank">{link.label}</a>
|
|
{/each}
|
|
</div>
|
|
{/if}
|
|
</Dialog>
|