var BS, QAContentToggle, React;
React = require('react');
BS = require('react-bootstrap');
QAContentToggle = React.createClass({displayName: "QAContentToggle",
propTypes: {
onChange: React.PropTypes.func.isRequired,
isShowingBook: React.PropTypes.bool.isRequired
},
onClick: function() {
return this.props.onChange({
book: !this.props.isShowingBook,
exercises: this.props.isShowingBook
});
},
render: function() {
var text;
text = this.props.isShowingBook ? 'Show Exercises' : 'Show Content';
return React.createElement(BS.NavItem, {
"className": 'teacher-edition',
"onClick": this.onClick
}, text);
}
});
module.exports = QAContentToggle;
|