This repository has no description
0

Configure Feed

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

web/api: crud ops for reactions

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

author
oppiliappan
date (Jul 30, 2026, 6:02 PM +0100) commit 41b8de8f parent 1424032c change-id vmloxkxl
+39 -2
+37
web/src/lib/api/reaction.ts
··· 1 + import { ok } from "@atcute/client"; 2 + import { mainSchema as putRecordSchema } from "@atcute/atproto/types/repo/putRecord"; 3 + import { mainSchema as deleteRecordSchema } from "@atcute/atproto/types/repo/deleteRecord"; 4 + import type { Nsid, RecordKey } from "@atcute/lexicons/syntax"; 5 + import type { OAuthUserAgent } from "@atcute/oauth-browser-client"; 6 + import { createClient } from "$lib/auth/agent"; 7 + import type { ReactionRecord, RecordView } from "./records"; 8 + 9 + const REACTION_COLLECTION = "sh.tangled.feed.reaction" as Nsid; 10 + 11 + export const putReaction = async ( 12 + agent: OAuthUserAgent, 13 + rkey: string, 14 + record: ReactionRecord 15 + ): Promise<RecordView<ReactionRecord>> => { 16 + const rpc = createClient(agent); 17 + const { uri, cid } = await ok( 18 + rpc.call(putRecordSchema, { 19 + input: { 20 + repo: agent.sub, 21 + collection: REACTION_COLLECTION, 22 + rkey: rkey as RecordKey, 23 + record 24 + } 25 + }) 26 + ); 27 + return { uri, cid, value: record }; 28 + }; 29 + 30 + export const deleteReaction = async (agent: OAuthUserAgent, rkey: string): Promise<void> => { 31 + const rpc = createClient(agent); 32 + await ok( 33 + rpc.call(deleteRecordSchema, { 34 + input: { repo: agent.sub, collection: REACTION_COLLECTION, rkey: rkey as RecordKey } 35 + }) 36 + ); 37 + };
+2 -2
web/src/routes/+layout.svelte
··· 32 32 33 33 <div 34 34 class={isAuthShell 35 - ? "flex min-h-screen flex-col bg-background-default text-foreground-default" 35 + ? "flex min-h-screen flex-col bg-background-default dark:bg-background-canvas text-foreground-default" 36 36 : isMarketingShell 37 37 ? "flex min-h-screen flex-col bg-gradient-to-b from-background-default to-background-canvas text-foreground-default" 38 38 : "flex min-h-screen flex-col bg-background-canvas text-foreground-default"} ··· 41 41 <header 42 42 class={isMarketingShell 43 43 ? "z-20 w-full bg-transparent pt-[env(safe-area-inset-top)]" 44 - : "sticky top-0 z-20 w-full bg-background-default pt-[env(safe-area-inset-top)]"} 44 + : "top-0 z-20 w-full bg-background-default pt-[env(safe-area-inset-top)]"} 45 45 > 46 46 <Topbar 47 47 user={auth.currentUser}