mirror of
https://github.com/immich-app/immich.git
synced 2025-07-09 03:04:16 -04:00
chore: migrate profile picture cropper modal (#19378)
This commit is contained in:
parent
a5d84ba552
commit
373b654156
@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import MenuOption from '$lib/components/shared-components/context-menu/menu-option.svelte';
|
import MenuOption from '$lib/components/shared-components/context-menu/menu-option.svelte';
|
||||||
import Portal from '$lib/components/shared-components/portal/portal.svelte';
|
import { modalManager } from '$lib/managers/modal-manager.svelte';
|
||||||
import ProfileImageCropper from '$lib/components/shared-components/profile-image-cropper.svelte';
|
import ProfileImageCropperModal from '$lib/modals/ProfileImageCropperModal.svelte';
|
||||||
import type { AssetResponseDto } from '@immich/sdk';
|
import type { AssetResponseDto } from '@immich/sdk';
|
||||||
import { mdiAccountCircleOutline } from '@mdi/js';
|
import { mdiAccountCircleOutline } from '@mdi/js';
|
||||||
import { t } from 'svelte-i18n';
|
import { t } from 'svelte-i18n';
|
||||||
@ -11,18 +11,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
let { asset }: Props = $props();
|
let { asset }: Props = $props();
|
||||||
|
|
||||||
let showProfileImageCrop = $state(false);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<MenuOption
|
<MenuOption
|
||||||
icon={mdiAccountCircleOutline}
|
icon={mdiAccountCircleOutline}
|
||||||
onClick={() => (showProfileImageCrop = true)}
|
onClick={() => modalManager.show(ProfileImageCropperModal, { asset })}
|
||||||
text={$t('set_as_profile_picture')}
|
text={$t('set_as_profile_picture')}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{#if showProfileImageCrop}
|
|
||||||
<Portal target="body">
|
|
||||||
<ProfileImageCropper {asset} onClose={() => (showProfileImageCrop = false)} />
|
|
||||||
</Portal>
|
|
||||||
{/if}
|
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
import domtoimage from 'dom-to-image';
|
import domtoimage from 'dom-to-image';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { t } from 'svelte-i18n';
|
import { t } from 'svelte-i18n';
|
||||||
import PhotoViewer from '../asset-viewer/photo-viewer.svelte';
|
import PhotoViewer from '../components/asset-viewer/photo-viewer.svelte';
|
||||||
import { NotificationType, notificationController } from './notification/notification';
|
import { NotificationType, notificationController } from '../components/shared-components/notification/notification';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
asset: AssetResponseDto;
|
asset: AssetResponseDto;
|
Loading…
x
Reference in New Issue
Block a user