Commit c389f54 1 parent d915f84 commit c389f54 Copy full SHA for c389f54
File tree 1 file changed +2
-4
lines changed
website/frontend/src/components/CleanAir/SecondaryNav
1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ const SecondaryNavComponent = ({ disabledTabs }) => {
22
22
if ( currentTab !== - 1 && ! disabledTabs . includes ( currentTab ) ) {
23
23
dispatch ( setActiveTab ( tabs [ currentTab ] ) ) ;
24
24
}
25
- } , [ location ] ) ; // Only re-run the effect if location changes
25
+ } , [ location ] ) ;
26
26
27
27
return (
28
28
< div className = "header-subnav" >
@@ -31,9 +31,7 @@ const SecondaryNavComponent = ({ disabledTabs }) => {
31
31
< Link to = { `/clean-air/${ tab . linkName } ` } key = { index } >
32
32
< li
33
33
className = { `${
34
- location . pathname . includes ( tab . linkName ) || activeTab . linkName === tab . linkName
35
- ? 'active'
36
- : ''
34
+ location . pathname . includes ( tab . linkName ) || activeTab === index ? 'active' : ''
37
35
} ${ disabledTabs . includes ( index ) ? 'disabled' : '' } `}
38
36
onClick = { ( ) => {
39
37
if ( ! disabledTabs . includes ( index ) ) {
You can’t perform that action at this time.
0 commit comments