Sha256: 2b07f90a4e956c8ebdc60c4117891eeaba7099167ba81a74b768b17d2f87f5c3

Contents?: true

Size: 808 Bytes

Versions: 12

Compression:

Stored size: 808 Bytes

Contents

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

  static get propsForClassNames() {
    return this._propsForClassNames = this._propsForClassNames || [
      'tiny',
      'small',
      'medium',
      'large',
      'alert',
      'disabled',
      'secondary',
      'success',
      'expand',
    ]
  }

  get className() {
    let classNamesObject = {RevButton: true}
    this.constructor.propsForClassNames.forEach((propName) => {
      classNamesObject[propName] = this.props[propName] || false
    })
    return this.classAdd(classNamesObject)
  }

  get passThroughProps() {
    return this.getPropsWithout(this._propsForClassNames)
  }

  render() {
    return <button {...this.passThroughProps} className={this.className}>
      {this.props.children}
    </button>
  }

})

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
revelry_core-0.1.24.0 app/assets/javascripts/revelry/ui/buttons/Button.es6
revelry_core-0.1.23.0 app/assets/javascripts/revelry/ui/buttons/Button.es6
revelry_core-0.1.22.0 app/assets/javascripts/revelry/ui/buttons/Button.es6
revelry_core-0.1.21.0 app/assets/javascripts/revelry/ui/buttons/Button.es6
revelry_core-0.1.20.0 app/assets/javascripts/revelry/ui/buttons/Button.es6
revelry_core-0.1.19.0 app/assets/javascripts/revelry/ui/buttons/Button.es6
revelry_core-0.1.18.0 app/assets/javascripts/revelry/ui/buttons/Button.es6
revelry_core-0.1.17.0 app/assets/javascripts/revelry/ui/buttons/Button.es6
revelry_core-0.1.16.0 app/assets/javascripts/revelry/ui/buttons/Button.es6
revelry_core-0.1.15.0 app/assets/javascripts/revelry/ui/buttons/Button.es6
revelry_core-0.1.14.0 app/assets/javascripts/revelry/ui/buttons/Button.es6
revelry_core-0.1.13.0 app/assets/javascripts/revelry/ui/buttons/Button.es6