pitaya-launcher/js/components/launcher/category-header.js

31 lines
719 B
JavaScript
Raw Normal View History

2015-08-27 18:24:29 +02:00
var React = require('react');
module.exports = React.createClass({
2015-08-27 22:52:30 +02:00
propTypes: {
onBackClick: React.PropTypes.func.isRequired,
itemPath: React.PropTypes.oneOfType([
React.PropTypes.string,
React.PropTypes.arrayOf(React.PropTypes.number)
]).isRequired,
item: React.PropTypes.object.isRequired,
},
2015-08-27 18:24:29 +02:00
2015-08-27 22:52:30 +02:00
render: function() {
2015-08-27 18:24:29 +02:00
return (
2015-08-27 22:52:30 +02:00
<div className="category-header">
<a href="#" onClick={this._onBackClick} className="goback" >&#9668;</a>
<span className="category-label">{this.props.item.label}</span>
2015-08-27 18:24:29 +02:00
</div>
);
2015-08-27 22:52:30 +02:00
},
_onBackClick: function(evt) {
evt.preventDefault();
this.props.onBackClick(this.props.itemPath, this.props.item);
2015-08-27 18:24:29 +02:00
}
});