Created
August 10, 2014 17:02
-
-
Save chrislaughlin/310aefb9cbf7e1e59b84 to your computer and use it in GitHub Desktop.
Link Component
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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