@@ -10,6 +10,8 @@ import classNames from 'classnames'
1010
1111import { Button , InputSelect , PageDivider } from '~/libs/ui'
1212import { getCountryLookup } from '~/libs/core/lib/profile/profile-functions/profile-store/profile-xhr.store'
13+ import { EnvironmentConfig } from '~/config'
14+ import { Member } from '~/apps/talent-search/src/lib/models'
1315
1416import { ProgressBar } from '../../components/progress-bar'
1517
@@ -30,6 +32,7 @@ const blankConnectInfo: ConnectInfo = emptyConnectInfo()
3032const PageAccountDetailsContent : FC < {
3133 reduxAddress : MemberAddress | null
3234 reduxConnectInfo : ConnectInfo | null
35+ reduxMemberInfo : Member | null
3336 updateMemberConnectInfos : ( infos : ConnectInfo [ ] ) => void
3437 createMemberConnectInfos : ( infos : ConnectInfo [ ] ) => void
3538 updateMemberHomeAddresss : ( infos : MemberAddress [ ] ) => void
@@ -133,7 +136,11 @@ const PageAccountDetailsContent: FC<{
133136 && ! loadingAddress
134137 && ! loadingConnectInfo
135138 && shouldNavigateTo . current ) {
136- navigate ( shouldNavigateTo . current )
139+ if ( shouldNavigateTo . current . startsWith ( '../' ) ) {
140+ navigate ( shouldNavigateTo . current )
141+ } else {
142+ window . location . href = shouldNavigateTo . current
143+ }
137144 }
138145 /* eslint-disable react-hooks/exhaustive-deps */
139146 } , [ loadingAddress , loadingConnectInfo ] )
@@ -313,8 +320,8 @@ const PageAccountDetailsContent: FC<{
313320
314321 < ProgressBar
315322 className = { styles . ProgressBar }
316- progress = { 6.0 / 7 }
317- label = '6/7 '
323+ progress = { 6.0 / 6 }
324+ label = '6/6 '
318325 />
319326
320327 < div className = { classNames ( 'd-flex justify-content-between' , styles . blockFooter ) } >
@@ -337,7 +344,16 @@ const PageAccountDetailsContent: FC<{
337344 size = 'lg'
338345 primary
339346 iconToLeft
340- disabled = { ! _ . isEmpty ( formErrors ) }
347+ disabled = { ! _ . isEmpty ( formErrors ) || ! props . reduxMemberInfo }
348+ onClick = { ( ) => {
349+ if ( loadingAddress || loadingConnectInfo ) {
350+ shouldNavigateTo . current
351+ = `${ EnvironmentConfig . USER_PROFILE_URL } /${ props . reduxMemberInfo ?. handle } `
352+ } else {
353+ window . location . href
354+ = `${ EnvironmentConfig . USER_PROFILE_URL } /${ props . reduxMemberInfo ?. handle } `
355+ }
356+ } }
341357 >
342358 next
343359 </ Button >
@@ -352,13 +368,15 @@ const mapStateToProps: any = (state: any) => {
352368 loadingMemberInfo,
353369 address,
354370 connectInfo,
371+ memberInfo,
355372 } : any = state . member
356373
357374 return {
358375 loadingMemberInfo,
359376 loadingMemberTraits,
360377 reduxAddress : address ,
361378 reduxConnectInfo : connectInfo ,
379+ reduxMemberInfo : memberInfo ,
362380 }
363381}
364382
0 commit comments