File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 1
1
/* global tcUniNav */
2
2
import React , { useEffect , useMemo , useRef } from 'react' ;
3
+ import PT from 'prop-types' ;
3
4
import { connect } from 'react-redux' ;
4
5
import { config } from 'topcoder-react-utils' ;
5
6
import LoadingIndicator from 'components/LoadingIndicator' ;
@@ -45,6 +46,11 @@ const TopcoderHeader = ({ auth }) => {
45
46
return type ;
46
47
} , [ ] ) ;
47
48
49
+ const navigationUserInfo = {
50
+ ...user ,
51
+ initials : getInitials ( user . firstName , user . lastName ) ,
52
+ } ;
53
+
48
54
useEffect ( ( ) => {
49
55
if ( uniNavInitialized . current ) {
50
56
return ;
@@ -53,6 +59,8 @@ const TopcoderHeader = ({ auth }) => {
53
59
54
60
uniNavInitialized . current = true ;
55
61
const user = _ . get ( auth , 'profile' ) || { } ;
62
+ const authToken = _ . get ( auth , 'tokenV3' ) ;
63
+ const isAuthenticated = ! ! authToken ;
56
64
57
65
counter += 1 ;
58
66
@@ -87,6 +95,13 @@ const TopcoderHeader = ({ auth }) => {
87
95
< div styleName = "header-container" id = { headerElId . current } ref = { headerRef } />
88
96
) ;
89
97
} ;
98
+ TopcoderHeader . defaultProps = {
99
+ auth : { } ,
100
+ } ;
101
+
102
+ TopcoderHeader . propTypes = {
103
+ auth : PT . shape ( ) ,
104
+ } ;
90
105
91
106
const mapStateToProps = state => ( {
92
107
auth : state . auth ,
You can’t perform that action at this time.
0 commit comments