From e6fbd40ac17567dce7be675c53b33e439da3d4a7 Mon Sep 17 00:00:00 2001 From: pray4skylark Date: Wed, 30 Sep 2026 17:23:14 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=95=8C=EB=A6=BC=20=EB=93=9C=EB=A1=AD?= =?UTF-8?q?=EB=8B=A4=EC=9A=B4=20=ED=81=B4=EB=A6=AD=20=EC=8B=9C=20=EC=97=B0?= =?UTF-8?q?=EA=B3=84=20=ED=8E=98=EC=9D=B4=EC=A7=80(linkUrl)=20=EB=94=A5?= =?UTF-8?q?=EB=A7=81=ED=81=AC=20=EC=9D=B4=EB=8F=99=20=EB=9D=BC=EC=9A=B0?= =?UTF-8?q?=ED=8C=85=20=EC=97=B0=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/layout/NotificationDropdown.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/layout/NotificationDropdown.tsx b/src/components/layout/NotificationDropdown.tsx index 6e43225..461487c 100644 --- a/src/components/layout/NotificationDropdown.tsx +++ b/src/components/layout/NotificationDropdown.tsx @@ -1,6 +1,7 @@ "use client"; import React, { useEffect, useRef } from 'react'; +import { useRouter } from 'next/navigation'; import { Bell, Check, AlertCircle, Info, AlertTriangle, XCircle } from 'lucide-react'; import { useNotificationStore } from '@/stores'; @@ -47,6 +48,7 @@ interface NotificationDropdownProps { } const NotificationDropdown = ({ isOpen, onClose }: NotificationDropdownProps) => { + const router = useRouter(); const dropdownRef = useRef(null); const notifications = useNotificationStore((s) => s.notifications); const markAsRead = useNotificationStore((s) => s.markAsRead); @@ -69,8 +71,12 @@ const NotificationDropdown = ({ isOpen, onClose }: NotificationDropdownProps) => }; }, [isOpen, onClose, fetchNotifications]); - const handleNotificationClick = async (id: number) => { - await markAsRead(id); + const handleNotificationClick = async (notification: { notificationId: number; linkUrl?: string }) => { + await markAsRead(notification.notificationId); + onClose(); + if (notification.linkUrl) { + router.push(notification.linkUrl); + } }; const handleMarkAllRead = async () => { @@ -115,7 +121,7 @@ const NotificationDropdown = ({ isOpen, onClose }: NotificationDropdownProps) => {notifications.map((notification) => (
  • handleNotificationClick(notification.notificationId)} + onClick={() => handleNotificationClick(notification)} className={`px-4 py-3 cursor-pointer transition-colors hover:bg-gray-50 ${ !notification.isRead ? 'bg-blue-50/50 hover:bg-blue-50' : '' }`}