UNPKG

react-jam-ui

Version:

React JAM UI components

42 lines (36 loc) 850 B
import React from 'react'; import classNames from 'classnames'; import './styles.styl' export default class Loader extends React.Component { constructor() { super(); this.state = { } } render() { const classes = classNames( 'loader', { [`loader-${this.props.type}`]: this.props.type }, this.props.size, this.props.className ); const size = this.props.child ? parseInt(this.props.child) : 9; const childrens = []; for (var i = 0; i < size; i++) { childrens.push(<i key={ `loader-${i}` }></i>); } return <div className={ classes }> { childrens } </div> } } /** <Loader type='default' width='100' height='100' child='6' /> **/