mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
refactor(web): prefer modal manager (#22152)
This commit is contained in:
parent
eee94207ce
commit
2d816e89ad
1 changed files with 106 additions and 108 deletions
|
|
@ -13,7 +13,7 @@
|
|||
type SharedLinkResponseDto,
|
||||
type UserResponseDto,
|
||||
} 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 { onMount } from 'svelte';
|
||||
import { t } from 'svelte-i18n';
|
||||
|
|
@ -29,9 +29,11 @@
|
|||
let users: UserResponseDto[] = $state([]);
|
||||
let selectedUsers: Record<string, { user: UserResponseDto; role: AlbumUserRole }> = $state({});
|
||||
|
||||
let sharedLinkUrl = $state('');
|
||||
const handleViewQrCode = (sharedLink: SharedLinkResponseDto) => {
|
||||
sharedLinkUrl = makeSharedLinkUrl(sharedLink);
|
||||
const handleViewQrCode = async (sharedLink: SharedLinkResponseDto) => {
|
||||
await modalManager.show(QrCodeModal, {
|
||||
title: $t('view_link'),
|
||||
value: makeSharedLinkUrl(sharedLink),
|
||||
});
|
||||
};
|
||||
|
||||
const roleOptions: Array<{ title: string; value: AlbumUserRole | 'none'; icon?: string }> = [
|
||||
|
|
@ -71,10 +73,7 @@
|
|||
};
|
||||
</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>
|
||||
{#if Object.keys(selectedUsers).length > 0}
|
||||
<div class="mb-2 py-2 sticky">
|
||||
|
|
@ -189,5 +188,4 @@
|
|||
>
|
||||
</Stack>
|
||||
</ModalBody>
|
||||
</Modal>
|
||||
{/if}
|
||||
</Modal>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue