diff --git a/src/components/NavBar.tsx b/src/components/NavBar.tsx index 88f5d40..e346cb0 100644 --- a/src/components/NavBar.tsx +++ b/src/components/NavBar.tsx @@ -8,31 +8,42 @@ const NavBar = () => { const navigate = useNavigate(); const location = useLocation(); + // 설정 관련 경로 목록 추가 + const settingsRelatedPaths = [ + '/settings', + '/profile', + '/security-privacy', + '/help-support', + '/payment-methods', + '/notifications' + ]; + + const isSettingsActive = settingsRelatedPaths.some(path => location.pathname === path); + const navItems = [ - { icon: Home, label: '홈', path: '/' }, - { icon: Calendar, label: '지출', path: '/transactions' }, - { icon: BarChart2, label: '분석', path: '/analytics' }, - { icon: Settings, label: '설정', path: '/settings' }, + { icon: Home, label: '홈', path: '/', isActive: location.pathname === '/' }, + { icon: Calendar, label: '지출', path: '/transactions', isActive: location.pathname === '/transactions' }, + { icon: BarChart2, label: '분석', path: '/analytics', isActive: location.pathname === '/analytics' }, + { icon: Settings, label: '설정', path: '/settings', isActive: isSettingsActive }, ]; return (
{navItems.map((item) => { - const isActive = location.pathname === item.path; return (