mirror of
https://github.com/immich-app/immich.git
synced 2025-01-10 13:56:47 +01:00
9d01885b58
* feat: disable activity * fix: disable reactions * fix: tests * fix: tests * fix: tests * pr feedback * pr feedback * chore: styling & wording * refactor component --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
34 lines
1.3 KiB
Svelte
34 lines
1.3 KiB
Svelte
<script lang="ts">
|
|
import { mdiCommentOutline, mdiHeart, mdiHeartOutline } from '@mdi/js';
|
|
import { createEventDispatcher } from 'svelte';
|
|
import Icon from '../elements/icon.svelte';
|
|
import type { ActivityResponseDto } from '@api';
|
|
|
|
export let isLiked: ActivityResponseDto | null;
|
|
export let numberOfComments: number | undefined;
|
|
export let isShowActivity: boolean | undefined;
|
|
export let disabled: boolean;
|
|
|
|
const dispatch = createEventDispatcher();
|
|
</script>
|
|
|
|
<div
|
|
class="w-full h-14 flex p-4 text-white items-center justify-center rounded-full gap-4 bg-immich-dark-bg bg-opacity-60"
|
|
>
|
|
<button class={disabled ? 'cursor-not-allowed' : ''} on:click={() => dispatch('favorite')} {disabled}>
|
|
<!-- svelte-ignore missing-declaration -->
|
|
<div class="items-center justify-center">
|
|
<Icon path={isLiked ? mdiHeart : mdiHeartOutline} size={24} />
|
|
</div>
|
|
</button>
|
|
<button on:click={() => dispatch('openActivityTab')}>
|
|
<div class="flex gap-2 items-center justify-center">
|
|
<Icon path={mdiCommentOutline} class="scale-x-[-1]" size={24} />
|
|
{#if numberOfComments}
|
|
<div class="text-xl">{numberOfComments}</div>
|
|
{:else if !isShowActivity}
|
|
<div class="text-lg">Say something</div>
|
|
{/if}
|
|
</div>
|
|
</button>
|
|
</div>
|