mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-03 03:04:27 +02:00
PARTIAL level toolbar rewrite
This commit is contained in:
parent
a4ea49c3b8
commit
9206820a8d
6 changed files with 99 additions and 94 deletions
72
src/js/react_views/LevelToolbarView.jsx
Normal file
72
src/js/react_views/LevelToolbarView.jsx
Normal file
|
@ -0,0 +1,72 @@
|
|||
var React = require('react');
|
||||
var PropTypes = React.PropTypes;
|
||||
|
||||
var intl = require('../intl');
|
||||
var reactUtil = require('../util/reactUtil');
|
||||
|
||||
var LevelToolbarView = React.createClass({
|
||||
|
||||
propTypes: {
|
||||
name: PropTypes.string.isRequired,
|
||||
onGoalClick: PropTypes.func.isRequired,
|
||||
onObjectiveClick: PropTypes.func.isRequired
|
||||
},
|
||||
|
||||
getInitialState: function() {
|
||||
return {
|
||||
isHidden: true
|
||||
};
|
||||
},
|
||||
|
||||
componentDidMount: function() {
|
||||
this.setState({
|
||||
isHidden: false
|
||||
});
|
||||
},
|
||||
|
||||
render: function() {
|
||||
return (
|
||||
<div className={reactUtil.joinClasses([
|
||||
'toolbar',
|
||||
'level-toolbar',
|
||||
'box',
|
||||
'vertical',
|
||||
'center',
|
||||
'transitionAll',
|
||||
this.state.isHidden ? 'hidden' : ''
|
||||
])}>
|
||||
<div className="clearfix">
|
||||
<div className="levelNameWrapper">
|
||||
<i className="icon-bolt"></i>
|
||||
{' Level '}
|
||||
<span className="levelToolbarSpan">
|
||||
{this.props.name}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="buttonsWrapper">
|
||||
<div className="showGoalWrapper">
|
||||
<button
|
||||
onClick={this.props.onGoalClick}
|
||||
type="button">
|
||||
{false ?
|
||||
intl.str('show-goal-button') :
|
||||
intl.str('hide-goal-button')
|
||||
}
|
||||
</button>
|
||||
</div>
|
||||
<div className="showObjectiveWrapper">
|
||||
<button
|
||||
onClick={this.props.onObjectiveClick}
|
||||
type="button">
|
||||
Objective
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
module.exports = LevelToolbarView;
|
Loading…
Add table
Add a link
Reference in a new issue