임동욱 임동욱 09-14
Merge branch 'claude/franchise-management-category-search-removal-ca3eaf' into hub
@4bf22e551e0befc3b1a22213fe13bf4bb15419eb
app/(protected)/(basic)/_components/admin-header.module.scss
--- app/(protected)/(basic)/_components/admin-header.module.scss
+++ app/(protected)/(basic)/_components/admin-header.module.scss
@@ -123,13 +123,36 @@
   letter-spacing: -0.025em;
 }
 
+.notificationLink {
+  color: inherit;
+  text-decoration: none;
+  cursor: pointer;
+
+  &:hover {
+    background: fox.color(action-default-hover);
+  }
+
+  &.notificationUnread:hover {
+    background: fox.color(action-primary-pressed);
+  }
+
+  &:focus-visible {
+    outline: fox.border(2) solid fox.color(border-theme-primary);
+    outline-offset: calc(-1 * #{fox.border(2)});
+  }
+}
+
 .notificationContent {
+  display: -webkit-box;
+  overflow: hidden;
   color: fox.color(font-neutral-subtle);
   font-family: fox.font-family(body);
   font-size: fox.font-size(body-sm);
   line-height: 1.5;
   letter-spacing: -0.025em;
   word-break: break-word;
+  -webkit-box-orient: vertical;
+  -webkit-line-clamp: 2;
 }
 
 .notificationEmpty {
app/(protected)/(basic)/_components/admin-header.tsx
--- app/(protected)/(basic)/_components/admin-header.tsx
+++ app/(protected)/(basic)/_components/admin-header.tsx
@@ -1,9 +1,14 @@
 'use client';
 
 import Image from 'next/image';
+import Link from 'next/link';
 import { useEffect, useRef, useState } from 'react';
 import { logout } from '@/app/(protected)/_actions';
-import { countUnread, type AdminNotification } from '@/lib/domain/notification';
+import {
+  countUnread,
+  resolveNotificationHref,
+  type AdminNotification,
+} from '@/lib/domain/notification';
 import styles from './admin-header.module.scss';
 import { HeaderIconButton } from './header-icon-button';
 
@@ -107,22 +112,38 @@
                 <p className={styles.notificationEmpty}>새 알림이 없습니다.</p>
               ) : (
                 <ul className={styles.notificationList}>
-                  {notifications.map((item) => (
-                    <li key={item.id}>
-                      <div
-                        className={`${styles.notification} ${
-                          item.isRead ? '' : styles.notificationUnread
-                        }`}
-                      >
+                  {notifications.map((item) => {
+                    const href = resolveNotificationHref(item);
+                    const className = `${styles.notification} ${
+                      item.isRead ? '' : styles.notificationUnread
+                    }`;
+                    const body = (
+                      <>
                         <span className={styles.notificationTitle}>
                           {item.title}
                         </span>
-                        <span className={styles.notificationContent}>
+                        <span className={styles.notificationContent} title={item.content}>
                           {item.content}
                         </span>
-                      </div>
-                    </li>
-                  ))}
+                      </>
+                    );
+                    return (
+                      <li key={item.id}>
+                        {href ? (
+                          <Link
+                            href={href}
+                            role="menuitem"
+                            className={`${className} ${styles.notificationLink}`}
+                            onClick={() => setIsNotificationOpen(false)}
+                          >
+                            {body}
+                          </Link>
+                        ) : (
+                          <div className={className}>{body}</div>
+                        )}
+                      </li>
+                    );
+                  })}
                 </ul>
               )}
             </div>
lib/domain/notification.ts
--- lib/domain/notification.ts
+++ lib/domain/notification.ts
@@ -1,3 +1,5 @@
+import { BOARD_PATHS } from '@/lib/domain/board-post-query';
+
 /**
  * 관리자 알림 한 건. 백엔드 `CmmNtcnVo`(`TB_COM_NTCN`).
  *
@@ -20,3 +22,14 @@
 ): number {
   return notifications.filter((item) => !item.isRead).length;
 }
+
+/**
+ * 이슈: `TB_COM_NTCN`에 대상(게시판·게시글) 컬럼이 없어 제목으로 가른다. 지금 적재되는 알림은
+ * 학습자 1:1문의 등록(`CmmBbsServiceImpl.insert`, 제목 "학습자 1:1 문의 등록") 하나다.
+ * 모르는 알림은 null — 누를 곳이 없다.
+ */
+export function resolveNotificationHref(
+  notification: AdminNotification
+): string | null {
+  return notification.title.includes('1:1 문의') ? BOARD_PATHS.inquiry : null;
+}
Add a comment
List