chore: migrate profile picture cropper modal (#19378)

This commit is contained in:
Daniel Dietzler 2025-06-20 20:16:10 +02:00 committed by GitHub
parent a5d84ba552
commit 373b654156
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 13 deletions

View File

@ -1,7 +1,7 @@
<script lang="ts">
import MenuOption from '$lib/components/shared-components/context-menu/menu-option.svelte';
import Portal from '$lib/components/shared-components/portal/portal.svelte';
import ProfileImageCropper from '$lib/components/shared-components/profile-image-cropper.svelte';
import { modalManager } from '$lib/managers/modal-manager.svelte';
import ProfileImageCropperModal from '$lib/modals/ProfileImageCropperModal.svelte';
import type { AssetResponseDto } from '@immich/sdk';
import { mdiAccountCircleOutline } from '@mdi/js';
import { t } from 'svelte-i18n';
@ -11,18 +11,10 @@
}
let { asset }: Props = $props();
let showProfileImageCrop = $state(false);
</script>
<MenuOption
icon={mdiAccountCircleOutline}
onClick={() => (showProfileImageCrop = true)}
onClick={() => modalManager.show(ProfileImageCropperModal, { asset })}
text={$t('set_as_profile_picture')}
/>
{#if showProfileImageCrop}
<Portal target="body">
<ProfileImageCropper {asset} onClose={() => (showProfileImageCrop = false)} />
</Portal>
{/if}

View File

@ -6,8 +6,8 @@
import domtoimage from 'dom-to-image';
import { onMount } from 'svelte';
import { t } from 'svelte-i18n';
import PhotoViewer from '../asset-viewer/photo-viewer.svelte';
import { NotificationType, notificationController } from './notification/notification';
import PhotoViewer from '../components/asset-viewer/photo-viewer.svelte';
import { NotificationType, notificationController } from '../components/shared-components/notification/notification';
interface Props {
asset: AssetResponseDto;