MCPcopy Create free account
hub / github.com/Lobos/react-ui / render

Method render

src/Icon.js:19–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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
50Icon.propTypes = {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected