mirror of
https://github.com/immich-app/immich.git
synced 2025-11-24 11:20:40 +09:00
feat(web): shared link filters (#15948)
This commit is contained in:
@@ -1,15 +1,22 @@
|
||||
<script lang="ts">
|
||||
import { goto } from '$app/navigation';
|
||||
import CircleIconButton from '$lib/components/elements/buttons/circle-icon-button.svelte';
|
||||
import MenuOption from '$lib/components/shared-components/context-menu/menu-option.svelte';
|
||||
import { AppRoute } from '$lib/constants';
|
||||
import type { SharedLinkResponseDto } from '@immich/sdk';
|
||||
import { mdiCircleEditOutline } from '@mdi/js';
|
||||
import { t } from 'svelte-i18n';
|
||||
|
||||
interface Props {
|
||||
menuItem?: boolean;
|
||||
onEdit: () => void;
|
||||
sharedLink: SharedLinkResponseDto;
|
||||
}
|
||||
|
||||
let { menuItem = false, onEdit }: Props = $props();
|
||||
let { sharedLink, menuItem = false }: Props = $props();
|
||||
|
||||
const onEdit = async () => {
|
||||
await goto(`${AppRoute.SHARED_LINKS}/${sharedLink.id}`);
|
||||
};
|
||||
</script>
|
||||
|
||||
{#if menuItem}
|
||||
|
||||
@@ -15,10 +15,9 @@
|
||||
interface Props {
|
||||
link: SharedLinkResponseDto;
|
||||
onDelete: () => void;
|
||||
onEdit: () => void;
|
||||
}
|
||||
|
||||
let { link, onDelete, onEdit }: Props = $props();
|
||||
let { link, onDelete }: Props = $props();
|
||||
|
||||
let now = DateTime.now();
|
||||
let expiresAt = $derived(link.expiresAt ? DateTime.fromISO(link.expiresAt) : undefined);
|
||||
@@ -95,10 +94,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</svelte:element>
|
||||
|
||||
<div class="flex flex-auto flex-col place-content-center place-items-end text-end ms-4">
|
||||
<div class="sm:flex hidden">
|
||||
<SharedLinkEdit {onEdit} />
|
||||
<SharedLinkEdit sharedLink={link} />
|
||||
<SharedLinkCopy {link} />
|
||||
<SharedLinkDelete {onDelete} />
|
||||
</div>
|
||||
@@ -112,7 +110,7 @@
|
||||
padding="3"
|
||||
hideContent
|
||||
>
|
||||
<SharedLinkEdit menuItem {onEdit} />
|
||||
<SharedLinkEdit menuItem sharedLink={link} />
|
||||
<SharedLinkCopy menuItem {link} />
|
||||
<SharedLinkDelete menuItem {onDelete} />
|
||||
</ButtonContextMenu>
|
||||
|
||||
Reference in New Issue
Block a user