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`); 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>