diff --git a/common/app/routes/Hikes/components/Hike.jsx b/common/app/routes/Hikes/components/Hike.jsx
index dbf00314d8..de5367ed09 100644
--- a/common/app/routes/Hikes/components/Hike.jsx
+++ b/common/app/routes/Hikes/components/Hike.jsx
@@ -12,11 +12,12 @@ export default React.createClass({
displayName: 'Hike',
propTypes: {
- showQuestions: PropTypes.bool,
- currentHike: PropTypes.object
+ dashedName: PropTypes.string,
+ currentHike: PropTypes.object,
+ showQuestions: PropTypes.bool
},
- renderBody(showQuestions, currentHike) {
+ renderBody(showQuestions, currentHike, dashedName) {
if (showQuestions) {
return (
@@ -30,13 +31,18 @@ export default React.createClass({
return (
);
},
render() {
- const { currentHike, showQuestions } = this.props;
+ const {
+ currentHike = {},
+ dashedName,
+ showQuestions
+ } = this.props;
const { title } = currentHike;
const videoTitle =
{ title }
;
@@ -47,7 +53,7 @@ export default React.createClass({
- { this.renderBody(showQuestions, currentHike) }
+ { this.renderBody(showQuestions, currentHike, dashedName) }
diff --git a/common/app/routes/Hikes/components/Hikes.jsx b/common/app/routes/Hikes/components/Hikes.jsx
index 7943b49320..33cf820666 100644
--- a/common/app/routes/Hikes/components/Hikes.jsx
+++ b/common/app/routes/Hikes/components/Hikes.jsx
@@ -30,7 +30,8 @@ export default contain(
appActions: PropTypes.object,
children: PropTypes.element,
currentHike: PropTypes.object,
- hikes: PropTypes.array
+ hikes: PropTypes.array,
+ params: PropTypes.object
},
componentWillMount() {
@@ -44,22 +45,23 @@ export default contain(
);
},
- renderChild(children, hikes, currentHike) {
+ renderChild(children, hikes, currentHike, dashedName) {
if (!children) {
return null;
}
- return React.cloneElement(children, { hikes, currentHike });
+ return React.cloneElement(children, { hikes, currentHike, dashedName });
},
render() {
const { hikes, children, currentHike } = this.props;
+ const { dashedName } = this.props.params;
const preventOverflow = { overflow: 'hidden' };
return (
{
// render sub-route
- this.renderChild(children, hikes, currentHike) ||
+ this.renderChild(children, hikes, currentHike, dashedName) ||
// if no sub-route render hikes map
this.renderMap(hikes)
}
diff --git a/common/app/routes/Hikes/components/Lecture.jsx b/common/app/routes/Hikes/components/Lecture.jsx
index b70c50d250..86ab935c6f 100644
--- a/common/app/routes/Hikes/components/Lecture.jsx
+++ b/common/app/routes/Hikes/components/Lecture.jsx
@@ -11,8 +11,9 @@ export default React.createClass({
mixins: [History],
propTypes: {
- currentHike: PropTypes.object,
- params: PropTypes.object
+ dashedName: PropTypes.string,
+ description: PropTypes.array,
+ id: PropTypes.string
},
handleError: debug,
@@ -29,12 +30,10 @@ export default React.createClass({
render() {
const {
- challengeSeed = ['1'],
+ id = '1',
+ dashedName,
description = []
- } = this.props.currentHike;
- const { dashedName } = this.props.params;
-
- const [ id ] = challengeSeed;
+ } = this.props;
return (