Guest User

Untitled

a guest
Jun 22nd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. export const formState = {
  2. progress: {
  3. groupId: 3,
  4. questionId: 5,
  5. },
  6. content: [
  7. {
  8. group: { id: 1, name: 'Company', description: 'Data regarding your company.', questions: 2 },
  9. questions: [
  10. {
  11. id: 1,
  12. type: 'textField',
  13. label: 'Required *',
  14. inputLabelProps: { shrink: true },
  15. text: 'group 1 question 1',
  16. answer: '',
  17. },
  18. ...
  19. ...
  20. ...
  21. ]
  22. }
  23.  
  24. const mapStateToProps = (state) => {
  25. console.log(state);
  26. return {
  27. progress: getProgressData(state),
  28. content: getContentData(state),
  29. };
  30. };
  31.  
  32. switch (action.type) {
  33. case UPDATE_PROGRESS:
  34. formState = state.get('formState');
  35. formState.progress = action.payload;
  36. console.log(formState);
  37. return state
  38. .set('formState', formState);
Add Comment
Please, Sign In to add comment