mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-27 08:28:50 +02:00
migrating old version react
to last version
This commit is contained in:
parent
634d0ad5e0
commit
64eb8ab773
10 changed files with 124 additions and 109 deletions
|
@ -1,31 +1,27 @@
|
|||
var React = require('react');
|
||||
var PropTypes = require('prop-types');
|
||||
var HelperBarView = require('../react_views/HelperBarView.jsx');
|
||||
var Main = require('../app');
|
||||
var React = require('react');
|
||||
|
||||
var log = require('../log');
|
||||
|
||||
var CommandsHelperBarView = React.createClass({
|
||||
class CommandsHelperBarView extends React.Component {
|
||||
|
||||
propTypes: {
|
||||
shown: React.PropTypes.bool.isRequired,
|
||||
onExit: React.PropTypes.func.isRequired
|
||||
},
|
||||
|
||||
render: function() {
|
||||
render() {
|
||||
return (
|
||||
<HelperBarView
|
||||
items={this.getItems()}
|
||||
shown={this.props.shown}
|
||||
/>
|
||||
);
|
||||
},
|
||||
}
|
||||
|
||||
fireCommand: function(command) {
|
||||
fireCommand(command) {
|
||||
log.viewInteracted('commandHelperBar');
|
||||
Main.getEventBaton().trigger('commandSubmitted', command);
|
||||
},
|
||||
}
|
||||
|
||||
getItems: function() {
|
||||
getItems() {
|
||||
return [{
|
||||
text: 'Levels',
|
||||
onClick: function() {
|
||||
|
@ -64,6 +60,11 @@ var CommandsHelperBarView = React.createClass({
|
|||
}];
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
CommandsHelperBarView.propTypes = {
|
||||
shown: PropTypes.bool.isRequired,
|
||||
onExit: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
module.exports = CommandsHelperBarView;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue