feat: distinguish between mention and reply notifications

This commit is contained in:
codytseng
2025-07-31 23:07:57 +08:00
parent 629ad3f7cd
commit 5107ce4b77
5 changed files with 56 additions and 50 deletions

View File

@@ -1,10 +1,9 @@
import { ExtendedKind } from '@/constants'
import { useMuteList } from '@/providers/MuteListProvider'
import { Event, kinds } from 'nostr-tools'
import { CommentNotification } from './CommentNotification'
import { MentionNotification } from './MentionNotification'
import { PollResponseNotification } from './PollResponseNotification'
import { ReactionNotification } from './ReactionNotification'
import { ReplyNotification } from './ReplyNotification'
import { RepostNotification } from './RepostNotification'
import { ZapNotification } from './ZapNotification'
@@ -22,8 +21,13 @@ export function NotificationItem({
if (notification.kind === kinds.Reaction) {
return <ReactionNotification notification={notification} isNew={isNew} />
}
if (notification.kind === kinds.ShortTextNote) {
return <ReplyNotification notification={notification} isNew={isNew} />
if (
notification.kind === kinds.ShortTextNote ||
notification.kind === ExtendedKind.COMMENT ||
notification.kind === ExtendedKind.VOICE_COMMENT ||
notification.kind === ExtendedKind.POLL
) {
return <MentionNotification notification={notification} isNew={isNew} />
}
if (notification.kind === kinds.Repost) {
return <RepostNotification notification={notification} isNew={isNew} />
@@ -31,12 +35,6 @@ export function NotificationItem({
if (notification.kind === kinds.Zap) {
return <ZapNotification notification={notification} isNew={isNew} />
}
if (
notification.kind === ExtendedKind.COMMENT ||
notification.kind === ExtendedKind.VOICE_COMMENT
) {
return <CommentNotification notification={notification} isNew={isNew} />
}
if (notification.kind === ExtendedKind.POLL_RESPONSE) {
return <PollResponseNotification notification={notification} isNew={isNew} />
}