Sha256: 5d2c943f86fbbb99aa3d52f352aead38b89c10201201b717327d88ada5ee23e5

Contents?: true

Size: 1010 Bytes

Versions: 12

Compression:

Stored size: 1010 Bytes

Contents

// <IconBarItem type="FontAwesome" icon="cog" />
Rev.registerComponent('IconBarItem', class IconBarItem extends React.Component {

  static get propTypes() {
    return {
      icon: React.PropTypes.string,
      type: React.PropTypes.string,
    }
  }

  render() {
    const classes = {
      'item': true,
      'RevIconBarItem': true,
    }

    return (
      <a {...this.props} className={this.classAdd(classes)}>
        {this.renderIcon()}
        <label className="RevIconBarItem-label">{this.props.children}</label>
      </a>
    )
  }

  renderIcon() {
    const classNameObject = {
      'RevIconBarItem-icon': true,
    }

    if(this.props.icon) {
      return (
        <Rev.Components.Icon
          type={this.props.type}
          icon={this.props.icon}
          className={this.classAdd(classNameObject)}
        />
      )
    }

    if(this.props.src) {
      return (
        <img src={this.props.src} className={this.classAdd(classNameObject)} />
      )
    }

    return null
  }
})

Version data entries

12 entries across 12 versions & 1 rubygems

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