diff --git a/app/(home-pages)/notifications/MentionNotification.tsx b/app/(home-pages)/notifications/MentionNotification.tsx index 523fc581..7a8fffe7 100644 --- a/app/(home-pages)/notifications/MentionNotification.tsx +++ b/app/(home-pages)/notifications/MentionNotification.tsx @@ -2,7 +2,7 @@ import { MentionTiny } from "components/Icons/MentionTiny"; import { ContentLayout, Notification } from "./Notification"; import { HydratedMentionNotification } from "src/notifications"; import { PubLeafletDocument, PubLeafletPublication } from "lexicons/api"; -import { AtUri } from "@atproto/api"; +import { Agent, AtUri } from "@atproto/api"; export const MentionNotification = (props: HydratedMentionNotification) => { const docRecord = props.document.data as PubLeafletDocument.Record; @@ -18,19 +18,36 @@ export const MentionNotification = (props: HydratedMentionNotification) => { let actionText: React.ReactNode; let mentionedItemName: string | undefined; + let mentionedDocRecord = props.mentionedDocument + ?.data as PubLeafletDocument.Record; + + let mentioner = "placeholder"; if (props.mention_type === "did") { - actionText = <>mentioned you; - } else if (props.mention_type === "publication" && props.mentionedPublication) { - const mentionedPubRecord = props.mentionedPublication.record as PubLeafletPublication.Record; + actionText = <>{mentioner} mentioned you; + } else if ( + props.mention_type === "publication" && + props.mentionedPublication + ) { + const mentionedPubRecord = props.mentionedPublication + .record as PubLeafletPublication.Record; mentionedItemName = mentionedPubRecord.name; - actionText = <>mentioned your publication {mentionedItemName}; + actionText = ( + <> + {mentioner} mentioned your publication{" "} + {mentionedItemName} + + ); } else if (props.mention_type === "document" && props.mentionedDocument) { - const mentionedDocRecord = props.mentionedDocument.data as PubLeafletDocument.Record; mentionedItemName = mentionedDocRecord.title; - actionText = <>mentioned your post {mentionedItemName}; + actionText = ( + <> + {mentioner} mentioned your post{" "} + {mentionedItemName} + + ); } else { - actionText = <>mentioned you; + actionText = <>{mentioner} mentioned you; } return ( @@ -42,7 +59,19 @@ export const MentionNotification = (props: HydratedMentionNotification) => { content={
- in {docRecord.title} + ... this should be some characters in front of{" "} + + {mentionedItemName ? mentionedItemName : "@handleplaceholder"} + {" "} + and some at the end...
} diff --git a/app/(home-pages)/notifications/Notification.tsx b/app/(home-pages)/notifications/Notification.tsx index 2d5c2710..197c6131 100644 --- a/app/(home-pages)/notifications/Notification.tsx +++ b/app/(home-pages)/notifications/Notification.tsx @@ -69,7 +69,7 @@ export const ContentLayout = (props: {
-
+
{props.postTitle}
{props.children}