From 2627bbabce18141b60a694aaeda99909287652d7 Mon Sep 17 00:00:00 2001 From: oppiliappan Date: Thu, 30 Jul 2026 11:44:21 +0100 Subject: [PATCH] web/components: add timeline component just a list of timeline events, but with the vertical line passing through them. extra sauce Signed-off-by: oppiliappan --- .../timeline/Timeline.stories.svelte | 83 +++++++++++++++++++ .../lib/components/timeline/Timeline.svelte | 35 ++++++++ web/src/routes/timeline/+page.svelte | 23 ++--- 3 files changed, 123 insertions(+), 18 deletions(-) create mode 100644 web/src/lib/components/timeline/Timeline.stories.svelte create mode 100644 web/src/lib/components/timeline/Timeline.svelte diff --git a/web/src/lib/components/timeline/Timeline.stories.svelte b/web/src/lib/components/timeline/Timeline.stories.svelte new file mode 100644 index 00000000..a2f3c6a0 --- /dev/null +++ b/web/src/lib/components/timeline/Timeline.stories.svelte @@ -0,0 +1,83 @@ + + + + {#snippet template(args)} + + + + {/snippet} + + + diff --git a/web/src/lib/components/timeline/Timeline.svelte b/web/src/lib/components/timeline/Timeline.svelte new file mode 100644 index 00000000..68288acb --- /dev/null +++ b/web/src/lib/components/timeline/Timeline.svelte @@ -0,0 +1,35 @@ + + +{#if feed.length > 0} +
+ {#each feed as item, i (item.event.uri)} + {@const event = item.event} +
+ + {#if i !== 0} + + {/if} + {#if event.$type === "sh.tangled.feed.getTimeline#repoEvent"} + + {:else if event.$type === "sh.tangled.feed.getTimeline#starEvent"} + + {:else if event.$type === "sh.tangled.feed.getTimeline#followEvent"} + + {/if} +
+ {/each} +
+{:else} + +{/if} diff --git a/web/src/routes/timeline/+page.svelte b/web/src/routes/timeline/+page.svelte index 14b9507b..a045354d 100644 --- a/web/src/routes/timeline/+page.svelte +++ b/web/src/routes/timeline/+page.svelte @@ -3,10 +3,7 @@ import GalleryVertical from "$icon/gallery-vertical"; import Button from "$lib/components/ui/Button.svelte"; import ButtonGroup from "$lib/components/ui/ButtonGroup.svelte"; - import EmptyState from "$lib/components/ui/EmptyState.svelte"; - import TimelineRepoEvent from "$lib/components/timeline/TimelineRepoEvent.svelte"; - import TimelineStarEvent from "$lib/components/timeline/TimelineStarEvent.svelte"; - import TimelineFollowEvent from "$lib/components/timeline/TimelineFollowEvent.svelte"; + import Timeline from "$lib/components/timeline/Timeline.svelte"; import type { PageData } from "./$types"; let { data }: { data: PageData } = $props(); @@ -36,18 +33,8 @@ {/if} - {#each data.feed as item (item.event.uri)} - {@const event = item.event} - {#if event.$type === "sh.tangled.feed.getTimeline#repoEvent"} - - {:else if event.$type === "sh.tangled.feed.getTimeline#starEvent"} - - {:else if event.$type === "sh.tangled.feed.getTimeline#followEvent"} - - {/if} - {:else} - - {/each} + -- 2.51.2