Adding condition for link configs so that whichever is not present will not render

This commit is contained in:
Swapnil Mishra 2017-01-25 15:29:10 +05:30
parent 0468cc151d
commit afe4b31854

View File

@ -6,37 +6,57 @@ import './style.css'
import '../../static/fonts/fontawesome/style.css' import '../../static/fonts/fontawesome/style.css'
class SiteLinks extends React.Component { class SiteLinks extends React.Component {
render() { render () {
return ( return (
<div className='blog-social'> <div className="blog-social">
<ul> <ul>
<li> {config.siteTwitterUrl && (
<a href={ config.siteTwitterUrl }><i className='fa fa-twitter'></i></a> <li>
</li> <a href={config.siteTwitterUrl}>
<li> <i className="fa fa-twitter" />
<a href={ config.siteGithubUrl }><i className='fa fa-github-alt'></i></a> </a>
</li> </li>
<li> )}
<a href={ config.siteVkUrl }><i className='fa fa-vk'></i></a> {config.siteGithubUrl && (
</li> <li>
</ul> <a href={config.siteGithubUrl}>
<ul> <i className="fa fa-github-alt" />
<li> </a>
<a href={ config.siteEmailUrl }><i className='fa fa-envelope-o'></i></a> </li>
</li> )}
<li> {config.siteVkUrl && (
<a href={ config.siteTelegramUrl }><i className='fa fa-paper-plane'></i></a> <li>
</li> <a href={config.siteVkUrl}><i className="fa fa-vk" /></a>
</ul> </li>
<ul> )}
<li> </ul>
<a href={ config.siteRssUrl }><i className='fa fa-rss'></i></a> <ul>
</li> {config.siteEmailUrl && (
</ul> <li>
</div> <a href={config.siteEmailUrl}>
); <i className="fa fa-envelope-o" />
} </a>
</li>
)}
{config.siteTelegramUrl && (
<li>
<a href={config.siteTelegramUrl}>
<i className="fa fa-paper-plane" />
</a>
</li>
)}
</ul>
<ul>
{config.siteRssUrl && (
<li>
<a href={config.siteRssUrl}><i className="fa fa-rss" /></a>
</li>
)}
</ul>
</div>
)
}
} }
export default SiteLinks export default SiteLinks