Update prop names and prop processing logic in Icon
This commit is contained in:
parent
18192cd93b
commit
80272ab8f0
1 changed files with 6 additions and 5 deletions
|
@ -5,14 +5,15 @@ import $clamp from 'clamp';
|
||||||
//component/icon.js
|
//component/icon.js
|
||||||
export let Icon = React.createClass({
|
export let Icon = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
style: React.PropTypes.object,
|
icon: React.PropTypes.string.isRequired,
|
||||||
fixed: React.PropTypes.bool,
|
|
||||||
className: React.PropTypes.string,
|
className: React.PropTypes.string,
|
||||||
|
fixed: React.PropTypes.bool,
|
||||||
},
|
},
|
||||||
render: function() {
|
render: function() {
|
||||||
var className = ('icon ' + ('fixed' in this.props ? 'icon-fixed-width ' : '') + this.props.icon + ' ' +
|
const {fixed, className, ...other} = this.props;
|
||||||
(this.props.className || ''));
|
const spanClassName = ('icon ' + ('fixed' in this.props ? 'icon-fixed-width ' : '') +
|
||||||
return <span className={className} style={this.props.style}></span>
|
this.props.icon + ' ' + (this.props.className || ''));
|
||||||
|
return <span className={spanClassName} {... other}></span>
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue