Lanceur d’application pour GNU/Linux
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
720B

  1. var React = require('react');
  2. module.exports = React.createClass({
  3. propTypes: {
  4. item: React.PropTypes.object.isRequired,
  5. itemPath: React.PropTypes.oneOfType([
  6. React.PropTypes.string,
  7. React.PropTypes.arrayOf(React.PropTypes.number)
  8. ]).isRequired,
  9. onItemClick: React.PropTypes.func.isRequired,
  10. },
  11. _onItemClick: function(evt) {
  12. evt.preventDefault();
  13. this.props.onItemClick(evt, this.props.itemPath, this.props.item);
  14. },
  15. render: function() {
  16. return (
  17. <li className="app-item" onClick={this._onItemClick}>
  18. <img className="app-icon" src={this.props.item.icon} />
  19. <span className="app-label">{this.props.item.label}</span>
  20. </li>
  21. );
  22. }
  23. });