File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -137,6 +137,8 @@ const MainNavLink = ({
137137 className ?: string ;
138138} ) => {
139139 const router = useRouter ( ) ;
140+ const isActiveNav = extractPathWithoutFragment ( router . asPath ) === uri ;
141+
140142 return (
141143 < Link
142144 href = { uri }
@@ -148,7 +150,13 @@ const MainNavLink = ({
148150 // ? 'text-primary hover:text-primary'
149151 // : 'text-slate-600 hover:text-primary'
150152 // }`,
151- `${ extractPathWithoutFragment ( router . asPath ) === uri ? 'text-primary dark:text-white dark:underline hover:text-primary' : 'text-slate-600 dark:text-white hover:text-primary dark:hover:underline' } ` ,
153+ // `${extractPathWithoutFragment(router.asPath) === uri ? 'text-primary dark:text-white dark:underline hover:text-primary' : 'text-slate-600 dark:text-white hover:text-primary dark:hover:underline'}`,
154+ {
155+ 'text-primary dark:text-white dark:underline hover:text-primary' :
156+ isActiveNav ,
157+ 'text-slate-600 dark:text-white hover:text-primary dark:hover:underline' :
158+ ! isActiveNav ,
159+ } ,
152160 ) }
153161 >
154162 { label }
You can’t perform that action at this time.
0 commit comments