move transcript rending into method

This commit is contained in:
Berkeley Martinez
2015-07-16 09:04:57 -07:00
parent 892fd64cf5
commit f5963192d1

View File

@ -44,17 +44,19 @@ export default contain(
this.transitionTo(`/hikes/${dashedName}/questions/1`);
},
renderTranscript(transcript) {
return transcript.map((line, index) => (
<p key={ index }>{ line }</p>
)
);
},
render() {
const {
title,
challengeSeed = ['1'],
description = []
} = this.props.currentHike;
const transcript = description.map(line => {
return (
<p>{ line }</p>
);
});
const [ id ] = challengeSeed;
@ -73,7 +75,7 @@ export default contain(
<Col xs={ 12 }>
<Panel>
<p>
{ transcript }
{ this.renderTranscript(description) }
</p>
</Panel>
<Panel>