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'
3
3
4
- import { LoadingSpinner , profileContext , ProfileContextData , UserProfile } from '../../../../lib'
4
+ import { LoadingSpinner , UserProfile } from '../../../../lib'
5
5
import {
6
6
TCACertificationEnrollmentBase ,
7
7
TCACertificationProviderData ,
@@ -18,31 +18,23 @@ const placeholderUserProfile: UserProfile = {
18
18
19
19
const placeholderEnrollment : TCACertificationEnrollmentBase = {
20
20
completedAt : new Date ( ) . toISOString ( ) ,
21
- completionUuid : 'test-uuid ' ,
21
+ completionUuid : 'certificate-number ' ,
22
22
userHandle : 'your_handle' ,
23
23
userName : 'Your Name' ,
24
24
} as TCACertificationEnrollmentBase
25
25
26
26
const UserCertificationPreview : FC < { } > = ( ) => {
27
- const { profile, initialized : profileReady } : ProfileContextData = useContext ( profileContext )
28
- const navigate : NavigateFunction = useNavigate ( )
29
-
30
27
const routeParams : Params < string > = useParams ( )
31
28
32
29
const {
33
30
certification,
31
+ ready,
34
32
} : TCACertificationProviderData
35
33
= useGetTCACertification ( `${ routeParams . certification } ` )
36
34
37
- useLayoutEffect ( ( ) => {
38
- if ( profileReady && ! profile ) {
39
- navigate ( '..' )
40
- }
41
- } , [ navigate , profile , profileReady ] )
42
-
43
35
return (
44
36
< >
45
- < LoadingSpinner hide = { profileReady } />
37
+ < LoadingSpinner hide = { ready } />
46
38
47
39
< UserCertificationViewBase
48
40
enrollment = { placeholderEnrollment }
0 commit comments