hikes/:dashedName renders questions
This commit is contained in:
@ -39,28 +39,37 @@ export default contain(
|
|||||||
debug('loading questions');
|
debug('loading questions');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
renderQuestions(questions) {
|
||||||
|
return questions.map(([question]) => {
|
||||||
|
return (
|
||||||
|
<Panel>
|
||||||
|
<p>{ question }</p>
|
||||||
|
</Panel>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
title,
|
title,
|
||||||
challengeSeed = ['1'],
|
challengeSeed = ['1'],
|
||||||
description = []
|
description = [],
|
||||||
|
tests: questions
|
||||||
} = this.props.currentHike;
|
} = this.props.currentHike;
|
||||||
|
|
||||||
const [ id ] = challengeSeed;
|
const [ id ] = challengeSeed;
|
||||||
|
|
||||||
|
const videoTitle = <h2>{ title }</h2>;
|
||||||
return (
|
return (
|
||||||
<Col xs={ 12 }>
|
<Col xs={ 12 }>
|
||||||
<Row>
|
<Row>
|
||||||
<Panel className={ 'text-center' }>
|
<Panel className={ 'text-center' } title={ videoTitle }>
|
||||||
<h2>{ title }</h2>
|
<Vimeo
|
||||||
|
onError={ this.handleError }
|
||||||
|
onFinish= { this.handleFinish }
|
||||||
|
videoId={ id } />
|
||||||
</Panel>
|
</Panel>
|
||||||
</Row>
|
</Row>
|
||||||
<Row>
|
|
||||||
<Vimeo
|
|
||||||
onError={ this.handleError }
|
|
||||||
onFinish= { this.handleFinish }
|
|
||||||
videoId={ id } />
|
|
||||||
</Row>
|
|
||||||
<Row>
|
<Row>
|
||||||
<Col xs={ 12 }>
|
<Col xs={ 12 }>
|
||||||
<Panel>
|
<Panel>
|
||||||
@ -70,6 +79,11 @@ export default contain(
|
|||||||
</Panel>
|
</Panel>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
<Row>
|
||||||
|
<Col xs={12}>
|
||||||
|
{ this.renderQuestions(questions) }
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
</Col>
|
</Col>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -10,8 +10,8 @@ const debug = debugFactory('freecc:servereact');
|
|||||||
// add routes here as they slowly get reactified
|
// add routes here as they slowly get reactified
|
||||||
// remove their individual controllers
|
// remove their individual controllers
|
||||||
const routes = [
|
const routes = [
|
||||||
'/Hikes',
|
'/hikes',
|
||||||
'/Hikes/:id',
|
'/hikes/*',
|
||||||
'/jobs'
|
'/jobs'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user