fix(projectCopmletion): Open completion modal for Project submission
This commit is contained in:
37
common/app/redux-form-reducer.js
Normal file
37
common/app/redux-form-reducer.js
Normal 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
|
||||
);
|
Reference in New Issue
Block a user