@@ -10,11 +10,12 @@ import {
1010} from 'react'
1111import classNames from 'classnames'
1212
13- import { EnvironmentConfig , PagePortalId } from '../config'
13+ import { EnvironmentConfig , PageSubheaderPortalId } from '../config'
1414import {
1515 authUrlLogin ,
1616 authUrlLogout ,
1717 authUrlSignup ,
18+ LoadingSpinner ,
1819 profileContext ,
1920 ProfileContextData ,
2021 routeContext ,
@@ -29,7 +30,7 @@ UniNavSnippet(EnvironmentConfig.UNIVERSAL_NAV.URL)
2930
3031const Header : FC = ( ) => {
3132
32- const { activeToolName } : RouteContextData = useContext ( routeContext )
33+ const { activeToolName, activeToolRoute } : RouteContextData = useContext ( routeContext )
3334 const { profile, initialized : profileReady } : ProfileContextData = useContext ( profileContext )
3435 const [ ready , setReady ] : [ boolean , Dispatch < SetStateAction < boolean > > ] = useState < boolean > ( false )
3536 const headerInit : MutableRefObject < boolean > = useRef ( false )
@@ -44,7 +45,7 @@ const Header: FC = () => {
4445 headerInit . current = true
4546
4647 tcUniNav (
47- 'tool ' ,
48+ 'init ' ,
4849 navElementId ,
4950 {
5051 onReady ( ) {
@@ -55,6 +56,8 @@ const Header: FC = () => {
5556 signOut ( ) { window . location . href = authUrlLogout } ,
5657 signUp ( ) { window . location . href = authUrlSignup ( ) } ,
5758 toolName : activeToolName ,
59+ toolRoute : activeToolRoute ,
60+ type : 'tool' ,
5861 user : profileReady && profile ? {
5962 handle : profile . handle ,
6063 initials : `${ profile . firstName . charAt ( 0 ) } ${ profile . lastName . charAt ( 0 ) } ` ,
@@ -65,15 +68,18 @@ const Header: FC = () => {
6568 )
6669 } , [
6770 activeToolName ,
71+ activeToolRoute ,
6872 profileReady ,
69- profile ] )
73+ profile ,
74+ ] )
7075
7176 return (
7277 < >
78+ < LoadingSpinner hide = { ready } />
7379 < div id = { navElementId } />
7480 < div
75- id = { PagePortalId }
76- className = { classNames ( 'full-width-relative' , ! ready && 'hidden' ) }
81+ id = { PageSubheaderPortalId }
82+ className = { classNames ( 'full-width-relative' ) }
7783 />
7884 </ >
7985 )
0 commit comments