diff --git a/web/src/lib/components/profile/VouchCard.svelte b/web/src/lib/components/profile/VouchCard.svelte index 3032e5da..1f21510c 100644 --- a/web/src/lib/components/profile/VouchCard.svelte +++ b/web/src/lib/components/profile/VouchCard.svelte @@ -1,39 +1,54 @@ -
-
- -
- - {vouch.handle} - - - {#if denounce} - -
+
+
+ {#if outgoing} +
- {#if vouch.reason} -

{vouch.reason}

- {/if} -
+
+
+ {#if outgoing} + {profileLabel} + {:else} + {vouch.handle} + {/if} + {denounce ? "denounced" : "vouched for"} + {#if outgoing} + {vouch.handle} + {:else} + {profileLabel} + {/if} + {relativeTime(vouch.createdAt)} +
+ {#if vouch.reason} +

{vouch.reason}

+ {/if} +
+ diff --git a/web/src/lib/components/profile/tabs/VouchTab.svelte b/web/src/lib/components/profile/tabs/VouchTab.svelte index 83e2f68e..45a23b33 100644 --- a/web/src/lib/components/profile/tabs/VouchTab.svelte +++ b/web/src/lib/components/profile/tabs/VouchTab.svelte @@ -3,7 +3,13 @@ import EmptyState from "../EmptyState.svelte"; import type { VouchData } from "../types"; - let { vouches }: { vouches: VouchData[] } = $props(); + let { + vouches, + isSelf, + profileHandle + }: { vouches: VouchData[]; isSelf: boolean; profileHandle: string } = $props(); + + const profileLabel = $derived(isSelf ? "you" : profileHandle);
@@ -11,9 +17,10 @@ {#if vouches.length === 0} {:else} -
+
+
{#each vouches as vouch (vouch.uri)} - + {/each}
{/if} diff --git a/web/src/lib/components/profile/types.ts b/web/src/lib/components/profile/types.ts index cb3de0d4..7125e2c3 100644 --- a/web/src/lib/components/profile/types.ts +++ b/web/src/lib/components/profile/types.ts @@ -59,6 +59,7 @@ export interface VouchData { handle: string; avatar?: string; kind: "vouch" | "denounce"; + direction: "incoming" | "outgoing"; reason?: string; createdAt: string; } diff --git a/web/src/routes/[handle]/+page.svelte b/web/src/routes/[handle]/+page.svelte index 28a74204..9b5db8a7 100644 --- a/web/src/routes/[handle]/+page.svelte +++ b/web/src/routes/[handle]/+page.svelte @@ -22,5 +22,5 @@ {:else if data.tab === "following"} {:else if data.tab === "vouches"} - + {/if}