From 4b46a9ea35b75196c12c3726a05643f25d0bd43f Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 15 Mar 2025 23:33:58 +0000 Subject: [PATCH] Fix help support icon color Fixes an issue where the settings icon was not correctly colored when navigating to the help and support page. --- src/components/NavBar.tsx | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) 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 (