공지사항 페이지 추가1

This commit is contained in:
wallace
2025-11-12 20:49:07 +09:00
parent 9d3ab9f8d8
commit c81f218a2b
2 changed files with 186 additions and 13 deletions

View File

@@ -4,7 +4,7 @@ import { useRouter } from 'next/navigation';
import Image from 'next/image';
import logo from '../logo.svg';
type ActivePage = 'home' | 'lecturelist' | 'studydata' | null;
type ActivePage = 'home' | 'lecturelist' | 'studydata' | 'announcement' | null;
interface HeaderProps {
activePage?: ActivePage;
@@ -14,15 +14,7 @@ export default function Header({ activePage = null }: HeaderProps) {
const router = useRouter();
const handleNoticeClick = () => {
if (activePage === 'home') {
window.scrollTo({ top: 1213, behavior: 'smooth' });
} else {
router.push('/');
// 홈 페이지로 이동 후 스크롤
setTimeout(() => {
window.scrollTo({ top: 1213, behavior: 'smooth' });
}, 100);
}
router.push('/announcement');
};
const handleLogout = () => {
@@ -37,9 +29,8 @@ export default function Header({ activePage = null }: HeaderProps) {
if (page === 'studydata' && activePage === 'studydata') {
return 'text-[#1669ca]';
}
if (page === 'notice' && activePage === 'home') {
// 홈 페이지에서는 공지사항이 활성화된 것으로 간주하지 않음
return 'text-[#515151] group-hover:text-blue-500';
if (page === 'notice' && activePage === 'announcement') {
return 'text-[#1669ca]';
}
return 'text-[#515151] group-hover:text-blue-500';
};