Skip to content

Commit

Permalink
fix(more): if no events i.e.activities or comments then show a message
Browse files Browse the repository at this point in the history
  • Loading branch information
NSUWAL123 committed Nov 12, 2024
1 parent 01d625f commit 281a6a3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/mapper/src/lib/components/more/activities.svelte
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
<script lang="ts">
import ActivitiesSkeleton from '$lib/components/more/skeleton/activities.svelte';
import type { TaskEventType } from '$lib/types';
import { getTaskStore } from '$store/tasks.svelte.ts';
interface Props {
taskEvents: TaskEventType[];
zoomToTask: (taskId: number) => void;
}
let { taskEvents, zoomToTask }: Props = $props();
const taskStore = getTaskStore();
</script>

<div class="overflow-y-scroll overflow-x-hidden flex flex-col gap-2 pb-2">
{#if false}
{#each Array.from({ length: 5 }) as _, index}
<ActivitiesSkeleton />
{/each}
{:else if taskEvents?.length === 0}
<div class="flex justify-center mt-10">
<p class="text-[#484848] text-base">
{taskStore?.selectedTaskId ? `No activities yet on task ${taskStore?.selectedTaskId}` : 'No activities yet'}
</p>
</div>
{:else}
{#each taskEvents as event}
<div class="flex flex-col gap-2 py-3 bg-[#F6F5F5] rounded-md mr-1">
Expand Down Expand Up @@ -54,13 +63,14 @@
}}
role="button"
tabindex="0"
onclick={() => {
zoomToTask(event?.task_id)}}
onclick={() => {
zoomToTask(event?.task_id);
}}
name="map"
class="!text-[1rem] text-[#484848] hover:text-red-600 cursor-pointer duration-200"
></hot-icon>
</div>
</div>
{/each}
{/if}
</div>
</div>
6 changes: 6 additions & 0 deletions src/mapper/src/lib/components/more/comment.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
{#each Array.from({ length: 5 }) as _, index}
<CommentSkeleton />
{/each}
{:else if comments?.length === 0}
<div class="flex justify-center mt-10">
<p class="text-[#484848] text-base">
{taskStore?.selectedTaskId ? `No comments yet on task ${taskStore?.selectedTaskId}` : 'No comments yet'}
</p>
</div>
{:else}
{#each comments as comment}
<div class="flex flex-col gap-2 py-3 bg-[#F6F5F5] rounded-md">
Expand Down

0 comments on commit 281a6a3

Please sign in to comment.