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