Add className prop to Icon

This commit is contained in:
Alex Liebowitz 2016-11-18 03:01:36 -05:00
parent f8c77a96cc
commit 84464a8118

View file

@ -4,9 +4,11 @@ var Icon = React.createClass({
propTypes: { propTypes: {
style: React.PropTypes.object, style: React.PropTypes.object,
fixed: React.PropTypes.bool, fixed: React.PropTypes.bool,
className: React.PropTypes.string,
}, },
render: function() { render: function() {
var className = 'icon ' + ('fixed' in this.props ? 'icon-fixed-width ' : '') + this.props.icon; var className = ('icon ' + ('fixed' in this.props ? 'icon-fixed-width ' : '') + this.props.icon + ' ' +
(this.props.className || ''));
return <span className={className} style={this.props.style}></span> return <span className={className} style={this.props.style}></span>
} }
}); });