import React, { useState, useEffect, useCallback } from 'react'; import { Link, useLocation } from 'react-router-dom'; import './Header.css'; const MENU = [ { id: 'company', label: '회사소개', children: [ { label: 'CEO 인사말', path: '/company/greeting' }, { label: '연혁', path: '/company/history' }, { label: '조직도', path: '/company/organization' }, { label: 'CI 소개', path: '/company/ci' }, { label: '오시는 길', path: '/company/location' }, ] }, { id: 'solution', label: '솔루션', children: [ { label: 'GUARDiA ITSM', path: '/solution/guardia', badge: 'NEW' }, { label: 'ERP', path: '/solution/erp' }, { label: 'CRM', path: '/solution/crm' }, { label: 'BI', path: '/solution/bi' }, ] }, { id: 'business', label: '사업실적', children: [ { label: '구축 레퍼런스', path: '/business/reference' }, { label: '파트너', path: '/business/partner' }, ] }, { id: 'support', label: '고객지원', children: [ { label: '공지사항', path: '/support/notice' }, { label: 'FAQ', path: '/support/faq' }, { label: '카탈로그', path: '/support/catalog' }, { label: '문의하기', path: '/support/contact' }, ] }, { id: 'recruit', label: '채용', children: [ { label: '채용공고', path: '/recruit/jobs' }, { label: '복리후생', path: '/recruit/welfare' }, { label: '지원하기', path: '/recruit/apply' }, ] }, { id: 'news', label: '뉴스', children: [ { label: '뉴스룸', path: '/news/newsroom' }, { label: '기술 블로그', path: '/news/blog' }, ] }, ]; export default function Header() { const [scrolled, setScrolled] = useState(false); const [activeMenu, setActiveMenu] = useState(null); const [mobileOpen, setMobileOpen] = useState(false); const location = useLocation(); useEffect(() => { const onScroll = () => setScrolled(window.scrollY > 60); window.addEventListener('scroll', onScroll, { passive: true }); return () => window.removeEventListener('scroll', onScroll); }, []); useEffect(() => { setMobileOpen(false); setActiveMenu(null); }, [location]); const isActive = (menu) => menu.children?.some(c => location.pathname.startsWith(c.path)); return ( <> {/* 접근성 스킵 링크 */} 본문 바로가기
{/* 로고 */} (주)지오정보기술 로고 { e.target.style.display='none'; e.target.nextSibling.style.display='flex'; }} /> ZioInfo {/* 데스크톱 메뉴 */} {/* 문의 버튼 */} 문의하기 {/* 햄버거 (모바일) */}
{/* 모바일 메뉴 */} {mobileOpen && ( )}
); }