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.

34 lines
809B

  1. var React = require('react');
  2. var AppItem = require('./app-item.jsx');
  3. module.exports = React.createClass({
  4. propTypes: {
  5. items: React.PropTypes.arrayOf(React.PropTypes.object).isRequired,
  6. parentPath: React.PropTypes.oneOfType([
  7. React.PropTypes.string,
  8. React.PropTypes.arrayOf(React.PropTypes.number)
  9. ]).isRequired,
  10. onItemClick: React.PropTypes.func.isRequired,
  11. },
  12. render: function() {
  13. var parentPath = this.props.parentPath;
  14. var items = (this.props.items).map(function(item, i) {
  15. var path = parentPath+'.'+i;
  16. return (
  17. <AppItem key={path} itemPath={path} item={item} onItemClick={this.props.onItemClick} />
  18. );
  19. }.bind(this));
  20. return (
  21. <ul key={parentPath} className="apps-list">
  22. {items}
  23. </ul>
  24. );
  25. }
  26. });