2015-08-27 22:52:30 +02:00
|
|
|
var React = require('react');
|
2015-09-04 12:10:08 +02:00
|
|
|
var AppIcon = require('../common/app-icon.jsx');
|
2015-08-27 22:52:30 +02:00
|
|
|
|
|
|
|
module.exports = React.createClass({
|
|
|
|
|
|
|
|
propTypes: {
|
|
|
|
item: React.PropTypes.object.isRequired,
|
|
|
|
itemPath: React.PropTypes.oneOfType([
|
|
|
|
React.PropTypes.string,
|
|
|
|
React.PropTypes.arrayOf(React.PropTypes.number)
|
|
|
|
]).isRequired,
|
|
|
|
onItemClick: React.PropTypes.func.isRequired,
|
|
|
|
},
|
|
|
|
|
|
|
|
_onItemClick: function(evt) {
|
|
|
|
evt.preventDefault();
|
|
|
|
this.props.onItemClick(evt, this.props.itemPath, this.props.item);
|
|
|
|
},
|
|
|
|
|
|
|
|
render: function() {
|
|
|
|
return (
|
|
|
|
<li className="app-item" onClick={this._onItemClick}>
|
2015-09-04 12:10:08 +02:00
|
|
|
<AppIcon icon={this.props.item.icon} theme={null} />
|
2015-08-27 22:52:30 +02:00
|
|
|
<span className="app-label">{this.props.item.label}</span>
|
|
|
|
</li>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|