File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
src/components/layout/gnb Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -8,13 +8,23 @@ import { Icon } from '@/components/icon';
88export const GNB = ( ) => {
99 const pathname = usePathname ( ) ;
1010
11+ const highLightPath = ( path : string ) => {
12+ if ( path === '/' ) {
13+ return pathname === '/' ;
14+ }
15+ return pathname . startsWith ( path ) ;
16+ } ;
17+
1118 return (
1219 < nav className = 'sticky bottom-0 z-100 h-14 border-t-1 border-gray-200 bg-white py-2' >
1320 < ul className = 'flex w-full justify-evenly gap-4' >
1421 { NAV_MENU . map ( ( { path, svgId } ) => (
1522 < li key = { path } >
1623 < Link href = { path } className = 'flex-center h-10 w-10' >
17- < Icon id = { svgId } className = { pathname === path ? 'text-mint-500' : 'text-gray-500' } />
24+ < Icon
25+ id = { svgId }
26+ className = { highLightPath ( path ) ? 'text-mint-500' : 'text-gray-500' }
27+ />
1828 </ Link >
1929 </ li >
2030 ) ) }
You can’t perform that action at this time.
0 commit comments