@@ -11,23 +11,25 @@ import CertificateView from '../certificate-view/CertificateView'
1111import styles from './UserCertificate.module.scss'
1212
1313const UserCertificate : FC < { } > = ( ) => {
14+
1415 const wrapElRef : MutableRefObject < HTMLElement | any > = useRef ( )
1516 const routeParams : Params < string > = useParams ( )
1617 const [ profile , setProfile ] : [
17- UserProfile | undefined ,
18- Dispatch < SetStateAction < UserProfile | undefined > >
18+ UserProfile | undefined ,
19+ Dispatch < SetStateAction < UserProfile | undefined > >
1920 ] = useState ( )
20- const [ profileReady , setProfileReady ] : [ boolean , Dispatch < SetStateAction < boolean > > ] = useState ( false )
21+ const [ profileReady , setProfileReady ] : [ boolean , Dispatch < SetStateAction < boolean > > ] = useState < boolean > ( false )
2122
2223 const providerParam : string = routeParams . provider ?? ''
2324 const certificationParam : string = routeParams . certification ?? ''
2425
2526 useEffect ( ( ) => {
2627 if ( routeParams . memberHandle ) {
27- profileGetAsync ( routeParams . memberHandle ) . then ( ( userProfile ) => {
28- setProfile ( userProfile )
29- setProfileReady ( true )
30- } )
28+ profileGetAsync ( routeParams . memberHandle )
29+ . then ( ( userProfile ) => {
30+ setProfile ( userProfile )
31+ setProfileReady ( true )
32+ } )
3133 }
3234 } , [ routeParams . memberHandle , setProfileReady ] )
3335
@@ -39,23 +41,23 @@ const UserCertificate: FC<{}> = () => {
3941
4042 [ ] . forEach . call ( el . parentElement ?. children ?? [ ] , ( c : HTMLElement ) => {
4143 if ( c !== el ) {
42- Object . assign ( c . style , { display : 'none' } )
44+ Object . assign ( c . style , { display : 'none' } )
4345 }
4446 } )
4547 el . classList . add ( styles [ 'full-screen-cert' ] )
4648 } )
4749
4850 return (
4951 < >
50- { ! profileReady && < LoadingSpinner show /> }
52+ < LoadingSpinner hide = { profileReady } />
5153
5254 { profileReady && profile && (
5355 < div ref = { wrapElRef } >
5456 < CertificateView
5557 certification = { certificationParam }
5658 profile = { profile }
5759 provider = { providerParam }
58- onCertificationNotCompleted = { ( ) => { } }
60+ onCertificationNotCompleted = { ( ) => { } }
5961 hideActions
6062 />
6163 </ div >
0 commit comments