hikes/:dashedName renders questions
parent
3dbe91e92d
commit
5ba0dc1fec
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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'
|
||||
];
|
||||
|
||||
|
|
Loading…
Reference in New Issue