hikes/:dashedName renders questions

pull/1319/head^2
Berkeley Martinez 2015-07-14 23:44:21 -07:00
parent 3dbe91e92d
commit 5ba0dc1fec
2 changed files with 25 additions and 11 deletions

View File

@ -39,28 +39,37 @@ export default contain(
debug('loading questions');
},
renderQuestions(questions) {
return questions.map(([question]) => {
return (
<Panel>
<p>{ question }</p>
</Panel>
);
});
},
render() {
const {
title,
challengeSeed = ['1'],
description = []
description = [],
tests: questions
} = this.props.currentHike;
const [ id ] = challengeSeed;
const videoTitle = <h2>{ title }</h2>;
return (
<Col xs={ 12 }>
<Row>
<Panel className={ 'text-center' }>
<h2>{ title }</h2>
<Panel className={ 'text-center' } title={ videoTitle }>
<Vimeo
onError={ this.handleError }
onFinish= { this.handleFinish }
videoId={ id } />
</Panel>
</Row>
<Row>
<Vimeo
onError={ this.handleError }
onFinish= { this.handleFinish }
videoId={ id } />
</Row>
<Row>
<Col xs={ 12 }>
<Panel>
@ -70,6 +79,11 @@ export default contain(
</Panel>
</Col>
</Row>
<Row>
<Col xs={12}>
{ this.renderQuestions(questions) }
</Col>
</Row>
</Col>
);
}

View File

@ -10,8 +10,8 @@ const debug = debugFactory('freecc:servereact');
// add routes here as they slowly get reactified
// remove their individual controllers
const routes = [
'/Hikes',
'/Hikes/:id',
'/hikes',
'/hikes/*',
'/jobs'
];