fix: filter out empty social links from static display (#87)

This commit is contained in:
Adam Butterworth
2019-03-13 14:13:10 -04:00
committed by GitHub
parent 83509c3415
commit 6709032aa8

View File

@@ -120,14 +120,17 @@ class SocialLinks extends React.Component {
content={intl.formatMessage(messages['profile.sociallinks.social.links'])}
/>
<ul className="list-unstyled">
{socialLinks.map(({ platform, socialLink }) => (
<StaticListItem
key={platform}
name={platformDisplayInfo[platform].name}
url={socialLink}
platform={platform}
/>
))}
{socialLinks
.filter(({ socialLink }) => Boolean(socialLink))
.map(({ platform, socialLink }) => (
<StaticListItem
key={platform}
name={platformDisplayInfo[platform].name}
url={socialLink}
platform={platform}
/>
))
}
</ul>
</React.Fragment>
),