feat: notifications inbox page
The bell only ever showed the last 30; add a full paginated /notifications page, per-notification mark-read, and a shared notificationHref helper so the bell and the page route identically instead of duplicating the logic. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
export type NotificationType = "follow" | "comment" | "reply" | "reaction" | "rating" | "mention";
|
||||
|
||||
export type NotificationLinkable = {
|
||||
type: NotificationType;
|
||||
recipeId: string | null;
|
||||
actorUsername: string | null;
|
||||
};
|
||||
|
||||
/** Where clicking a notification should navigate to. Shared by the bell dropdown
|
||||
* and the full notifications page so the two never drift apart. */
|
||||
export function notificationHref(n: NotificationLinkable): string {
|
||||
if (n.type === "follow") return n.actorUsername ? `/u/${n.actorUsername}` : "#";
|
||||
if (n.recipeId) return `/recipes/${n.recipeId}`;
|
||||
return "#";
|
||||
}
|
||||
Reference in New Issue
Block a user