add question header

This commit is contained in:
Berkeley Martinez
2015-07-22 14:18:37 -07:00
parent b38f9baa3c
commit 9485bdd20a

View File

@@ -206,15 +206,17 @@ export default React.createClass({
); );
}, },
renderQuestion(question, answer, shake) { renderQuestion(number, question, answer, shake) {
return ({ val: { x } }) => { return ({ val: { x } }) => {
const style = { const style = {
WebkitTransform: `translate3d(${ x }px, 0, 0)`, WebkitTransform: `translate3d(${ x }px, 0, 0)`,
transform: `translate3d(${ x }px, 0, 0)` transform: `translate3d(${ x }px, 0, 0)`
}; };
const title = <h4>Question { number }</h4>;
return ( return (
<Panel <Panel
className={ shake ? 'animated swing shake' : '' } className={ shake ? 'animated swing shake' : '' }
header={ title }
onMouseDown={ this.handleMouseDown } onMouseDown={ this.handleMouseDown }
onMouseLeave={ this.handleMouseUp } onMouseLeave={ this.handleMouseUp }
onMouseMove={ this.handleMouseMove(answer) } onMouseMove={ this.handleMouseMove(answer) }
@@ -243,7 +245,7 @@ export default React.createClass({
xsOffset={ 2 }> xsOffset={ 2 }>
<Row> <Row>
<Spring endValue={ this.getTweenValues }> <Spring endValue={ this.getTweenValues }>
{ this.renderQuestion(question, answer, shake) } { this.renderQuestion(number, question, answer, shake) }
</Spring> </Spring>
{ this.renderInfo(showInfo, info) } { this.renderInfo(showInfo, info) }
<Panel> <Panel>