diff --git a/src/components/NotificationBell.tsx b/src/components/NotificationBell.tsx index b0c1934..04f9063 100644 --- a/src/components/NotificationBell.tsx +++ b/src/components/NotificationBell.tsx @@ -2,7 +2,7 @@ import { dateLocaleCode } from '@/lib/dateFnsI18n'; import { useEffect, useMemo, useState } from 'react'; import { Link } from 'react-router-dom'; import { nip19 } from 'nostr-tools'; -import { Bell, Users, Check, Loader2, EyeOff, Globe, CheckCheck, Heart, Radio, ArrowRight, Handshake } from 'lucide-react'; +import { Bell, Users, Check, Loader2, EyeOff, Globe, CheckCheck, Heart, Radio, ArrowRight, Handshake, MessageCircle } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'; import { ScrollArea } from '@/components/ui/scroll-area'; @@ -18,6 +18,7 @@ import { ImageWithFallback } from '@/components/ImageWithFallback'; import { EmptyState as SharedEmptyState } from '@/components/EmptyState'; import { useCrewNotifications, useIsPendingMember } from '@/hooks/useCrewNotifications'; import { useCordnJoinNotifications } from '@/hooks/useCordnJoinNotifications'; +import { useDmUnreadSummary } from '@/hooks/useDmUnreadSummary'; import { useActivityNotifications } from '@/hooks/useActivityNotifications'; import { useTradeNotifications } from '@/hooks/useTradeNotifications'; import { useNotificationsRead } from '@/hooks/useNotificationsRead'; @@ -226,6 +227,7 @@ export function NotificationBell({ isLoading: cordnJoinLoading, dismiss: dismissCordnJoin, } = useCordnJoinNotifications(open); + const { unreadCount: unreadDms, markSeen: markDmEnvelopesSeen } = useDmUnreadSummary(!!user); const { lastRead, seenAt, markAllRead } = useNotificationsRead(); // Buying/selling steps: an offer on your listing, a counter it's your turn to @@ -285,7 +287,7 @@ export function NotificationBell({ ); // Badge = only UNACKNOWLEDGED items, so "Mark read" actually clears it. - const badgeTotal = unreadCrew + unreadActivity + unreadNewsletter + unreadTrades; + const badgeTotal = unreadCrew + unreadActivity + unreadNewsletter + unreadTrades + unreadDms; // Opening the bell marks social + crew as read (and newsletter, since the // News tab is right there). Newsletter read state also clears on the /newsletter page. @@ -359,7 +361,7 @@ export function NotificationBell({ {badgeTotal > 0 ? (