File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 1
1
import _ from 'lodash' ;
2
- import React , { useState } from 'react' ;
2
+ import React , { useState , useEffect } from 'react' ;
3
3
import PT from 'prop-types' ;
4
4
import { config } from 'topcoder-react-utils' ;
5
5
import Logo from 'assets/images/tc-logo.svg' ;
18
18
19
19
const Header = ( { profile } ) => {
20
20
const [ activeLevel1Id , setActiveLevel1Id ] = useState ( ) ;
21
+ const [ path , setPath ] = useState ( ) ;
21
22
const [ openMore , setOpenMore ] = useState ( true ) ;
22
23
23
24
const handleChangeLevel1Id = ( menuId ) => {
@@ -44,6 +45,9 @@ const Header = ({ profile }) => {
44
45
normalizedProfile = null ;
45
46
}
46
47
48
+ useEffect ( ( ) => {
49
+ setPath ( window . location . pathname ) ;
50
+ } , [ ] ) ;
47
51
if ( TopNavRef ) {
48
52
return (
49
53
< div >
@@ -67,6 +71,7 @@ const Header = ({ profile }) => {
67
71
theme = { config . HEADER_MENU_THEME }
68
72
currentLevel1Id = { activeLevel1Id }
69
73
onChangeLevel1Id = { handleChangeLevel1Id }
74
+ path = { path }
70
75
openMore = { openMore }
71
76
setOpenMore = { handleChangeOpenMore }
72
77
/>
You can’t perform that action at this time.
0 commit comments