Video end goes to questions
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import React, { PropTypes } from 'react';
|
||||
import { contain } from 'thundercats-react';
|
||||
import { Col, Row, Panel } from 'react-bootstrap';
|
||||
import { Navigation } from 'react-router';
|
||||
import { contain } from 'thundercats-react';
|
||||
import stampit from 'react-stampit';
|
||||
import Vimeo from 'react-vimeo';
|
||||
import debugFactory from 'debug';
|
||||
@ -31,28 +32,23 @@ export default contain(
|
||||
displayName: 'Lecture',
|
||||
|
||||
propTypes: {
|
||||
params: PropTypes.object
|
||||
params: PropTypes.object,
|
||||
currentHike: PropTypes.object
|
||||
},
|
||||
|
||||
handleError: debug,
|
||||
|
||||
handleFinish() {
|
||||
debug('loading questions');
|
||||
},
|
||||
|
||||
renderQuestions(questions) {
|
||||
return questions.map(([question]) => {
|
||||
return (
|
||||
<Panel>
|
||||
<p>{ question }</p>
|
||||
</Panel>
|
||||
);
|
||||
});
|
||||
const { dashedName } = this.props.params;
|
||||
this.transitionTo(`hikes/${dashedName}/questions/1`);
|
||||
},
|
||||
|
||||
render() {
|
||||
const {
|
||||
title,
|
||||
challengeSeed = ['1']
|
||||
challengeSeed = ['1'],
|
||||
description = []
|
||||
} = this.props.currentHike;
|
||||
|
||||
const [ id ] = challengeSeed;
|
||||
@ -64,12 +60,21 @@ export default contain(
|
||||
<Panel className={ 'text-center' } title={ videoTitle }>
|
||||
<Vimeo
|
||||
onError={ this.handleError }
|
||||
onFinish= { this.handleFinish }
|
||||
onFinish= { ::this.handleFinish }
|
||||
videoId={ id } />
|
||||
</Panel>
|
||||
</Row>
|
||||
<Row>
|
||||
<Col xs={ 12 }>
|
||||
<Panel>
|
||||
<p>
|
||||
{ description.join('\n') }
|
||||
</p>
|
||||
</Panel>
|
||||
</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
);
|
||||
}
|
||||
})
|
||||
}).compose(Navigation)
|
||||
);
|
||||
|
@ -14,7 +14,7 @@ export default {
|
||||
path: ':dashedName',
|
||||
component: Lecture
|
||||
}, {
|
||||
path: ':dashedName/questions',
|
||||
path: ':dashedName/questions/:number',
|
||||
component: Question
|
||||
}]
|
||||
};
|
||||
|
@ -91,7 +91,7 @@
|
||||
"react": "^0.13.3",
|
||||
"react-bootstrap": "^0.23.5",
|
||||
"react-router": "https://github.com/BerkeleyTrue/react-router#freecodecamp",
|
||||
"react-stampit": "^0.6.1",
|
||||
"react-stampit": "git+https://github.com/BerkeleyTrue/react-stampit.git#fcc",
|
||||
"react-vimeo": "^0.0.3",
|
||||
"request": "~2.53.0",
|
||||
"rx": "^2.5.3",
|
||||
|
Reference in New Issue
Block a user