()
| 17 | } |
| 18 | |
| 19 | render () { |
| 20 | let classes = [`${prefix}`]; |
| 21 | let { style, font, size, icon } = this.props; |
| 22 | |
| 23 | if (this.state.spin) { |
| 24 | classes.push(`${prefix}-spin`); |
| 25 | } |
| 26 | |
| 27 | if (icon) { |
| 28 | classes.push(`${prefix}-${icon}`); |
| 29 | } |
| 30 | |
| 31 | if (font) { |
| 32 | style.fontFamily = font; |
| 33 | } |
| 34 | |
| 35 | if (size) { |
| 36 | if (typeof size === 'number' || size.length === 1) { |
| 37 | size = size + 'x'; |
| 38 | } |
| 39 | classes.push(`${prefix}-${size}`); |
| 40 | } |
| 41 | |
| 42 | return ( |
| 43 | <i style={style} className={classnames(...classes)}> |
| 44 | {this.props.children} |
| 45 | </i> |
| 46 | ); |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | Icon.propTypes = { |
nothing calls this directly
no outgoing calls
no test coverage detected