mirror of
https://github.com/immich-app/immich.git
synced 2025-12-21 17:25:35 +03:00
refactor(web): prefer modal manager (#22152)
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
type SharedLinkResponseDto,
|
type SharedLinkResponseDto,
|
||||||
type UserResponseDto,
|
type UserResponseDto,
|
||||||
} from '@immich/sdk';
|
} from '@immich/sdk';
|
||||||
import { Button, Icon, Link, Modal, ModalBody, Stack, Text } from '@immich/ui';
|
import { Button, Icon, Link, Modal, ModalBody, modalManager, Stack, Text } from '@immich/ui';
|
||||||
import { mdiCheck, mdiEye, mdiLink, mdiPencil } from '@mdi/js';
|
import { mdiCheck, mdiEye, mdiLink, mdiPencil } from '@mdi/js';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { t } from 'svelte-i18n';
|
import { t } from 'svelte-i18n';
|
||||||
@@ -29,9 +29,11 @@
|
|||||||
let users: UserResponseDto[] = $state([]);
|
let users: UserResponseDto[] = $state([]);
|
||||||
let selectedUsers: Record<string, { user: UserResponseDto; role: AlbumUserRole }> = $state({});
|
let selectedUsers: Record<string, { user: UserResponseDto; role: AlbumUserRole }> = $state({});
|
||||||
|
|
||||||
let sharedLinkUrl = $state('');
|
const handleViewQrCode = async (sharedLink: SharedLinkResponseDto) => {
|
||||||
const handleViewQrCode = (sharedLink: SharedLinkResponseDto) => {
|
await modalManager.show(QrCodeModal, {
|
||||||
sharedLinkUrl = makeSharedLinkUrl(sharedLink);
|
title: $t('view_link'),
|
||||||
|
value: makeSharedLinkUrl(sharedLink),
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const roleOptions: Array<{ title: string; value: AlbumUserRole | 'none'; icon?: string }> = [
|
const roleOptions: Array<{ title: string; value: AlbumUserRole | 'none'; icon?: string }> = [
|
||||||
@@ -71,9 +73,6 @@
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if sharedLinkUrl}
|
|
||||||
<QrCodeModal title={$t('view_link')} onClose={() => (sharedLinkUrl = '')} value={sharedLinkUrl} />
|
|
||||||
{:else}
|
|
||||||
<Modal size="small" title={$t('share')} {onClose}>
|
<Modal size="small" title={$t('share')} {onClose}>
|
||||||
<ModalBody>
|
<ModalBody>
|
||||||
{#if Object.keys(selectedUsers).length > 0}
|
{#if Object.keys(selectedUsers).length > 0}
|
||||||
@@ -190,4 +189,3 @@
|
|||||||
</Stack>
|
</Stack>
|
||||||
</ModalBody>
|
</ModalBody>
|
||||||
</Modal>
|
</Modal>
|
||||||
{/if}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user