Sha256: 5dee3ca899f9cfdd4d392faafd64b34171f90b2eed62deb29613af1c9c4fbc36

Contents?: true

Size: 501 Bytes

Versions: 12

Compression:

Stored size: 501 Bytes

Contents

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

  static get propTypes() {
    return {
      count: React.PropTypes.number.isRequired,
      one: React.PropTypes.string.isRequired,
      more: React.PropTypes.string,
    }
  }

  get text() {
    if(this.props.count === 1) {
      return `${this.props.count} ${this.props.one}`
    }
    return `${this.props.count} ${this.props.more || this.props.one+'s'}`
  }

  render() {
    return <span>{this.text}</span>
  }
})

Version data entries

12 entries across 12 versions & 1 rubygems

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