Sha256: 4e246e3e3a26bb4ca75108212ae9409cd570d19385ca12eab9474550e979c0ff

Contents?: true

Size: 551 Bytes

Versions: 6

Compression:

Stored size: 551 Bytes

Contents

Rev.registerComponent('Emptyable', class extends React.Component {

  static get propTypes() {
    return {
      componentClass: React.PropTypes.element,
      emptyState: React.PropTypes.element.isRequired,
    }
  }

  static get defaultProps() {
    return {
      componentClass: 'div',
    }
  }

  render() {
    if(this.props.children && this.props.children.length > 0) {
      return React.createElement(
        this.props.componentClass,
        this.props,
        this.props.children
      )
    }
    return this.props.emptyState
  }
})

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
revelry_core-0.1.12.6 app/assets/javascripts/revelry/ui/lists/Emptyable.es6
revelry_core-0.1.12.5 app/assets/javascripts/revelry/ui/lists/Emptyable.es6
revelry_core-0.1.12.4 app/assets/javascripts/revelry/ui/lists/Emptyable.es6
revelry_core-0.1.12.3 app/assets/javascripts/revelry/ui/lists/Emptyable.es6
revelry_core-0.1.12.2 app/assets/javascripts/revelry/ui/lists/Emptyable.es6
revelry_core-0.1.12.0 app/assets/javascripts/revelry/ui/lists/Emptyable.es6