fix(projectCopmletion): Open completion modal for Project submission

This commit is contained in:
Stuart Taylor
2018-02-28 10:06:50 +00:00
parent 6cf3fb6049
commit 6a163bae88
6 changed files with 91 additions and 40 deletions

View File

@@ -0,0 +1,37 @@
import { composeReducers } from 'berkeleys-redux-utils';
import { reducer as formReducer } from 'redux-form';
import {
projectNormalizer,
types as challenge
} from './routes/Challenges/redux';
const normailizedFormReducer = formReducer.normalize({ ...projectNormalizer });
const pluggedInFormReducer = formReducer.plugin({
NewFrontEndProject: (state, action) => {
if (action.type === challenge.moveToNextChallenge) {
return {
...state,
solution: {}
};
}
return state;
},
NewBackEndProject: (state, action) => {
if (action.type === challenge.moveToNextChallenge) {
return {
...state,
solution: {},
githubLink: {}
};
}
return state;
}
});
export default composeReducers(
'form',
normailizedFormReducer,
pluggedInFormReducer
);