1
- import React , { useState } from 'react' ;
1
+ import React , { Fragment , useState } from 'react' ;
2
2
import PT from 'prop-types' ;
3
3
4
4
import './styles.scss' ;
@@ -20,25 +20,33 @@ const TcaCertificates = ({ certifications, courses, memberHandle }) => {
20
20
Topcoder Academy
21
21
</ h3 >
22
22
23
- < h4 styleName = "category-title" > Certifications</ h4 >
24
- < List
25
- certificates = { certifications }
26
- isVerified
27
- onClick = { certificate => setShowCertificationCertificate ( certificate ) }
28
- renderIcon = { enrollment => (
29
- < CertificationBadge
30
- type = { enrollment . topcoderCertification . certificationCategory . track || 'DEV' }
31
- level = { enrollment . topcoderCertification . learnerLevel || 'Beginner' }
23
+ { certifications . length > 0 && (
24
+ < Fragment >
25
+ < h4 styleName = "category-title" > Certifications</ h4 >
26
+ < List
27
+ certificates = { certifications }
28
+ isVerified
29
+ onClick = { certificate => setShowCertificationCertificate ( certificate ) }
30
+ renderIcon = { enrollment => (
31
+ < CertificationBadge
32
+ type = { enrollment . topcoderCertification . certificationCategory . track || 'DEV' }
33
+ level = { enrollment . topcoderCertification . learnerLevel || 'Beginner' }
34
+ />
35
+ ) }
32
36
/>
33
- ) }
34
- />
35
- < h4 styleName = "category-title" > Courses</ h4 >
36
- < List
37
- certificates = { courses }
38
- isVerified
39
- onClick = { certificate => setShowCourseCertificate ( certificate ) }
40
- renderIcon = { certificate => < CourseBadge type = { certificate . certificationTrackType || 'DEV' } /> }
41
- />
37
+ </ Fragment >
38
+ ) }
39
+ { courses . length > 0 && (
40
+ < Fragment >
41
+ < h4 styleName = "category-title" > Courses</ h4 >
42
+ < List
43
+ certificates = { courses }
44
+ isVerified
45
+ onClick = { certificate => setShowCourseCertificate ( certificate ) }
46
+ renderIcon = { certificate => < CourseBadge type = { certificate . certificationTrackType || 'DEV' } /> }
47
+ />
48
+ </ Fragment >
49
+ ) }
42
50
43
51
{ showCertificationCertificate && (
44
52
< TcaCertificationCertificateModal
0 commit comments