mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
chore(web): migration svelte 5 syntax (#13883)
This commit is contained in:
parent
9203a61709
commit
0b3742cf13
310 changed files with 6435 additions and 4176 deletions
|
|
@ -1,4 +1,4 @@
|
|||
<script lang="ts" context="module">
|
||||
<script lang="ts" module>
|
||||
import { createContext } from '$lib/utils/context';
|
||||
import { t } from 'svelte-i18n';
|
||||
|
||||
|
|
@ -17,10 +17,16 @@
|
|||
import type { AssetResponseDto } from '@immich/sdk';
|
||||
import { mdiClose } from '@mdi/js';
|
||||
import ControlAppBar from '../shared-components/control-app-bar.svelte';
|
||||
import type { Snippet } from 'svelte';
|
||||
|
||||
export let assets: Set<AssetResponseDto>;
|
||||
export let clearSelect: () => void;
|
||||
export let ownerId: string | undefined = undefined;
|
||||
interface Props {
|
||||
assets: Set<AssetResponseDto>;
|
||||
clearSelect: () => void;
|
||||
ownerId?: string | undefined;
|
||||
children?: Snippet;
|
||||
}
|
||||
|
||||
let { assets, clearSelect, ownerId = undefined, children }: Props = $props();
|
||||
|
||||
setContext({
|
||||
getAssets: () => assets,
|
||||
|
|
@ -31,9 +37,13 @@
|
|||
</script>
|
||||
|
||||
<ControlAppBar onClose={clearSelect} backIcon={mdiClose} tailwindClasses="bg-white shadow-md">
|
||||
<div class="font-medium text-immich-primary dark:text-immich-dark-primary" slot="leading">
|
||||
<p class="block sm:hidden">{assets.size}</p>
|
||||
<p class="hidden sm:block">{$t('selected_count', { values: { count: assets.size } })}</p>
|
||||
</div>
|
||||
<slot slot="trailing" />
|
||||
{#snippet leading()}
|
||||
<div class="font-medium text-immich-primary dark:text-immich-dark-primary">
|
||||
<p class="block sm:hidden">{assets.size}</p>
|
||||
<p class="hidden sm:block">{$t('selected_count', { values: { count: assets.size } })}</p>
|
||||
</div>
|
||||
{/snippet}
|
||||
{#snippet trailing()}
|
||||
{@render children?.()}
|
||||
{/snippet}
|
||||
</ControlAppBar>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue