mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +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
|
|
@ -10,12 +10,20 @@
|
|||
import FullScreenModal from '$lib/components/shared-components/full-screen-modal.svelte';
|
||||
import { t } from 'svelte-i18n';
|
||||
|
||||
export let asset: AssetResponseDto;
|
||||
export let onClose: () => void;
|
||||
interface Props {
|
||||
asset: AssetResponseDto;
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
let imgElement: HTMLDivElement;
|
||||
let { asset, onClose }: Props = $props();
|
||||
|
||||
let imgElement: HTMLDivElement | undefined = $state();
|
||||
|
||||
onMount(() => {
|
||||
if (!imgElement) {
|
||||
return;
|
||||
}
|
||||
|
||||
imgElement.style.width = '100%';
|
||||
});
|
||||
|
||||
|
|
@ -45,6 +53,10 @@
|
|||
};
|
||||
|
||||
const handleSetProfilePicture = async () => {
|
||||
if (!imgElement) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const blob = await domtoimage.toBlob(imgElement);
|
||||
if (await hasTransparentPixels(blob)) {
|
||||
|
|
@ -79,7 +91,8 @@
|
|||
<PhotoViewer bind:element={imgElement} {asset} />
|
||||
</div>
|
||||
</div>
|
||||
<svelte:fragment slot="sticky-bottom">
|
||||
<Button fullwidth on:click={handleSetProfilePicture}>{$t('set_as_profile_picture')}</Button>
|
||||
</svelte:fragment>
|
||||
|
||||
{#snippet stickyBottom()}
|
||||
<Button fullwidth onclick={handleSetProfilePicture}>{$t('set_as_profile_picture')}</Button>
|
||||
{/snippet}
|
||||
</FullScreenModal>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue