From def690b28263fd35a0109b72f13902adb412adfc Mon Sep 17 00:00:00 2001 From: Stuart Taylor Date: Sat, 23 Dec 2017 11:53:34 +0000 Subject: [PATCH 1/3] fix(step-challenge): Fix duplicate keys in Step --- common/app/routes/Challenges/views/step/Step.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/app/routes/Challenges/views/step/Step.jsx b/common/app/routes/Challenges/views/step/Step.jsx index 1038350dda7..477b68fb8c8 100644 --- a/common/app/routes/Challenges/views/step/Step.jsx +++ b/common/app/routes/Challenges/views/step/Step.jsx @@ -177,13 +177,13 @@ export class StepChallenge extends PureComponent { step, stepBackward, stepForward - }) { + }, index) { if (!Array.isArray(step)) { return null; } const [imgUrl, imgAlt, info, action] = step; return ( -
+
( -
+ return steps.map(([ imgUrl, imgAlt ], index) => ( +
{ Date: Thu, 28 Dec 2017 18:56:24 +0000 Subject: [PATCH 2/3] fix(step-keys): Use description slice for key --- common/app/routes/Challenges/views/step/Step.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/app/routes/Challenges/views/step/Step.jsx b/common/app/routes/Challenges/views/step/Step.jsx index 477b68fb8c8..03634c7cad5 100644 --- a/common/app/routes/Challenges/views/step/Step.jsx +++ b/common/app/routes/Challenges/views/step/Step.jsx @@ -177,13 +177,13 @@ export class StepChallenge extends PureComponent { step, stepBackward, stepForward - }, index) { + }) { if (!Array.isArray(step)) { return null; } const [imgUrl, imgAlt, info, action] = step; return ( -
+
( -
+ return steps.map(([ imgUrl, imgAlt, info ]) => ( +
{ Date: Thu, 28 Dec 2017 18:59:04 +0000 Subject: [PATCH 3/3] chore(step-redux): Remove console.log --- .../app/routes/Challenges/views/step/Step.jsx | 21 ++++++++++--------- .../Challenges/views/step/redux/index.js | 5 +---- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/common/app/routes/Challenges/views/step/Step.jsx b/common/app/routes/Challenges/views/step/Step.jsx index 03634c7cad5..921af0b7973 100644 --- a/common/app/routes/Challenges/views/step/Step.jsx +++ b/common/app/routes/Challenges/views/step/Step.jsx @@ -167,16 +167,17 @@ export class StepChallenge extends PureComponent { ); } - renderStep({ - clickOnImage, - completeAction, - currentIndex, - isActionCompleted, - isLastStep, - numOfSteps, - step, - stepBackward, - stepForward + renderStep( + { + clickOnImage, + completeAction, + currentIndex, + isActionCompleted, + isLastStep, + numOfSteps, + step, + stepBackward, + stepForward }) { if (!Array.isArray(step)) { return null; diff --git a/common/app/routes/Challenges/views/step/redux/index.js b/common/app/routes/Challenges/views/step/redux/index.js index 98d0ac9dc19..c9c13f89acb 100644 --- a/common/app/routes/Challenges/views/step/redux/index.js +++ b/common/app/routes/Challenges/views/step/redux/index.js @@ -63,10 +63,7 @@ export const actionCompletedSelector = state => getNS(state).isActionCompleted; export default handleActions( () => ({ - [challenges.challengeUpdated]: () => { - console.log('updating step ui'); - return initialState; - }, + [challenges.challengeUpdated]: () => initialState, [types.goToStep]: (state, { payload: { step = 0, isUnlocked }}) => ({ ...state, currentIndex: step,