Implement notification history feature

Adds a notification history view accessible from the header, including a clear button and a notification count badge.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-22 06:15:41 +00:00
parent 89f31521db
commit 0d49c4b8ae
6 changed files with 245 additions and 5 deletions

View File

@@ -1,11 +1,12 @@
import React, { useState, useEffect } from 'react';
import { Bell } from 'lucide-react';
import { useAuth } from '@/contexts/auth';
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
import { Skeleton } from '@/components/ui/skeleton';
import { useAuth } from '@/contexts/auth';
import { useIsMobile } from '@/hooks/use-mobile';
import { isIOSPlatform } from '@/utils/platform';
import NotificationPopover from './notification/NotificationPopover';
import useNotifications from '@/hooks/useNotifications';
const Header: React.FC = () => {
const {
@@ -16,6 +17,7 @@ const Header: React.FC = () => {
const [imageError, setImageError] = useState(false);
const isMobile = useIsMobile();
const [isIOS, setIsIOS] = useState(false);
const { notifications, clearAllNotifications, markAsRead } = useNotifications();
// 플랫폼 감지
useEffect(() => {
@@ -64,9 +66,13 @@ const Header: React.FC = () => {
<p className="text-gray-500 text-left"> </p>
</div>
</div>
<button className="neuro-flat p-2.5 rounded-full">
<Bell size={20} className="text-gray-600" />
</button>
<div className="neuro-flat p-2.5 rounded-full">
<NotificationPopover
notifications={notifications}
onClearAll={clearAllNotifications}
onReadNotification={markAsRead}
/>
</div>
</div>
</header>
);