This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

web/components: add reactions to components

Signed-off-by: oppiliappan <me@oppi.li>

author
oppiliappan
committer
dawn
date (Jul 31, 2026, 10:57 PM +0300) commit e2789770 parent 26f0d501 change-id qmnxqrpy
+12 -2
+1
web/src/lib/components/comment/Comment.stories.svelte
··· 18 18 createdAt: byjp.createdAt, 19 19 body: byjp.body, 20 20 bodyHtml: byjp.bodyHtml, 21 + subjectUri: byjp.uri, 21 22 variant: "top" 22 23 } 23 24 });
+11 -2
web/src/lib/components/comment/Comment.svelte
··· 2 2 import type { Snippet } from "svelte"; 3 3 import Avatar from "$lib/components/ui/Avatar.svelte"; 4 4 import TimeAgo from "$lib/components/ui/TimeAgo.svelte"; 5 + import Reactions from "$lib/components/reaction/Reactions.svelte"; 6 + import type { ReactionGroup } from "$lib/components/reaction/reactions"; 5 7 6 8 interface Props { 7 9 authorHandle: string; ··· 11 13 bodyHtml: string | null; 12 14 variant?: "top" | "reply"; 13 15 deleted?: boolean; 14 - // when provided, replaces the body region (e.g. an inline edit form), leaving 15 - // the avatar/handle header untouched so it doesn't shift 16 + reactions?: ReactionGroup[]; 17 + subjectUri: string; 18 + onreactionschange?: (next: ReactionGroup[]) => void; 16 19 editor?: Snippet; 17 20 } 18 21 ··· 24 27 bodyHtml, 25 28 variant = "top", 26 29 deleted = false, 30 + reactions = [], 31 + subjectUri, 32 + onreactionschange, 27 33 editor 28 34 }: Props = $props(); 29 35 </script> ··· 55 61 <article class="markup mt-1">{@html bodyHtml}</article> 56 62 {:else if body} 57 63 <article class="mt-1 whitespace-pre-wrap text-foreground-default">{body}</article> 64 + {/if} 65 + {#if !editor} 66 + <Reactions {reactions} {subjectUri} onchange={onreactionschange} class="mt-2" /> 58 67 {/if} 59 68 </div> 60 69 </div>