feat: mention

This commit is contained in:
gosangam
2026-06-10 16:29:44 +05:30
parent 482a845f37
commit 909ae67320
10 changed files with 628 additions and 66 deletions
+9 -5
View File
@@ -137,14 +137,16 @@ function NotificationRow({
</div>
);
// A like links to your own post; everything else links to the actor's
// profile (when we know their handle).
// A like links to your own post; a mention links to the actor's post you
// were tagged in; everything else links to the actor's profile.
const href =
n.kind === "post_like" && n.post_id
? `/u/${selfHandle}/posts#post-${n.post_id}`
: n.actor_handle
? `/u/${n.actor_handle}`
: null;
: n.kind === "post_mention" && n.post_id && n.actor_handle
? `/u/${n.actor_handle}/posts#post-${n.post_id}`
: n.actor_handle
? `/u/${n.actor_handle}`
: null;
return href ? (
<li>
@@ -177,6 +179,8 @@ function messageFor(n: AppNotification): string {
if (others <= 0) return "liked your post.";
return `and ${others} ${others === 1 ? "other" : "others"} liked your post.`;
}
case "post_mention":
return "mentioned you in a post.";
default:
return "sent you a notification.";
}