Skip to content

Instantly share code, notes, and snippets.

@chrislaughlin
Created August 10, 2014 17:02
Show Gist options
  • Save chrislaughlin/310aefb9cbf7e1e59b84 to your computer and use it in GitHub Desktop.
Save chrislaughlin/310aefb9cbf7e1e59b84 to your computer and use it in GitHub Desktop.
Link Component
var Link = React.createClass({
getClassFromLinkType: function(linkType) {
switch(linkType) {
case 'github':
return 'fa fa-github-alt fa-3x';
case 'facebook':
return 'fa fa-facebook-square fa-3x';
case 'linkedin':
return 'fa fa-linkedin-square fa-3x';
case 'twitter':
return 'fa fa-twitter-square fa-3x';
case 'cv':
return 'fa fa-file-text fa-3x';
case 'blog':
return 'fa fa-wordpress fa-3x';
}
},
render: function() {
return React.DOM.a({
href: this.props.source,
className: this.getClassFromLinkType(this.props.linkType)
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment