move transcript rending into method
This commit is contained in:
@ -44,17 +44,19 @@ export default contain(
|
|||||||
this.transitionTo(`/hikes/${dashedName}/questions/1`);
|
this.transitionTo(`/hikes/${dashedName}/questions/1`);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
renderTranscript(transcript) {
|
||||||
|
return transcript.map((line, index) => (
|
||||||
|
<p key={ index }>{ line }</p>
|
||||||
|
)
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
title,
|
title,
|
||||||
challengeSeed = ['1'],
|
challengeSeed = ['1'],
|
||||||
description = []
|
description = []
|
||||||
} = this.props.currentHike;
|
} = this.props.currentHike;
|
||||||
const transcript = description.map(line => {
|
|
||||||
return (
|
|
||||||
<p>{ line }</p>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
const [ id ] = challengeSeed;
|
const [ id ] = challengeSeed;
|
||||||
|
|
||||||
@ -73,7 +75,7 @@ export default contain(
|
|||||||
<Col xs={ 12 }>
|
<Col xs={ 12 }>
|
||||||
<Panel>
|
<Panel>
|
||||||
<p>
|
<p>
|
||||||
{ transcript }
|
{ this.renderTranscript(description) }
|
||||||
</p>
|
</p>
|
||||||
</Panel>
|
</Panel>
|
||||||
<Panel>
|
<Panel>
|
||||||
|
Reference in New Issue
Block a user