1- import { FC , useContext , useLayoutEffect } from 'react'
2- import { NavigateFunction , Params , useNavigate , useParams } from 'react-router-dom'
1+ import { FC } from 'react'
2+ import { Params , useParams } from 'react-router-dom'
33
4- import { LoadingSpinner , profileContext , ProfileContextData , UserProfile } from '../../../../lib'
4+ import { LoadingSpinner , UserProfile } from '../../../../lib'
55import {
66 TCACertificationEnrollmentBase ,
77 TCACertificationProviderData ,
@@ -18,31 +18,23 @@ const placeholderUserProfile: UserProfile = {
1818
1919const placeholderEnrollment : TCACertificationEnrollmentBase = {
2020 completedAt : new Date ( ) . toISOString ( ) ,
21- completionUuid : 'test-uuid ' ,
21+ completionUuid : 'certificate-number ' ,
2222 userHandle : 'your_handle' ,
2323 userName : 'Your Name' ,
2424} as TCACertificationEnrollmentBase
2525
2626const UserCertificationPreview : FC < { } > = ( ) => {
27- const { profile, initialized : profileReady } : ProfileContextData = useContext ( profileContext )
28- const navigate : NavigateFunction = useNavigate ( )
29-
3027 const routeParams : Params < string > = useParams ( )
3128
3229 const {
3330 certification,
31+ ready,
3432 } : TCACertificationProviderData
3533 = useGetTCACertification ( `${ routeParams . certification } ` )
3634
37- useLayoutEffect ( ( ) => {
38- if ( profileReady && ! profile ) {
39- navigate ( '..' )
40- }
41- } , [ navigate , profile , profileReady ] )
42-
4335 return (
4436 < >
45- < LoadingSpinner hide = { profileReady } />
37+ < LoadingSpinner hide = { ready } />
4638
4739 < UserCertificationViewBase
4840 enrollment = { placeholderEnrollment }
0 commit comments