You've already forked immich
mirror of
https://github.com/immich-app/immich.git
synced 2025-07-03 05:46:58 +02:00
Add navbar button to copy image (#961)
* Add navbar button to copy image * Use global event for copy image * merge upstream * Fixed missing required props * feat(web): Show notification after copying image to clipboard * chore(web): Fix typescript error * chore(web): Formatting Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
@ -11,10 +11,13 @@
|
||||
import MenuOption from '../shared-components/context-menu/menu-option.svelte';
|
||||
import Star from 'svelte-material-icons/Star.svelte';
|
||||
import StarOutline from 'svelte-material-icons/StarOutline.svelte';
|
||||
import ContentCopy from 'svelte-material-icons/ContentCopy.svelte';
|
||||
|
||||
import { page } from '$app/stores';
|
||||
import { AssetResponseDto } from '../../../api';
|
||||
|
||||
export let asset: AssetResponseDto;
|
||||
export let showCopyButton: boolean;
|
||||
|
||||
const isOwner = asset.ownerId === $page.data.user.id;
|
||||
|
||||
@ -45,6 +48,15 @@
|
||||
<CircleIconButton logo={ArrowLeft} on:click={() => dispatch('goBack')} />
|
||||
</div>
|
||||
<div class="text-white flex gap-2">
|
||||
{#if showCopyButton}
|
||||
<CircleIconButton
|
||||
logo={ContentCopy}
|
||||
on:click={() => {
|
||||
const copyEvent = new CustomEvent('copyImage');
|
||||
window.dispatchEvent(copyEvent);
|
||||
}}
|
||||
/>
|
||||
{/if}
|
||||
<CircleIconButton logo={CloudDownloadOutline} on:click={() => dispatch('download')} />
|
||||
<CircleIconButton logo={InformationOutline} on:click={() => dispatch('showDetail')} />
|
||||
{#if isOwner}
|
||||
|
Reference in New Issue
Block a user