MetaPhase-Consulting/State-TalentMAP

View on GitHub
src/reducers/profileMenu/profileMenu.js

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
export function profileMenuExpanded(state = true, action) {
  switch (action.type) {
    case 'PROFILE_MENU_EXPANDED':
      return action.isExpanded;
    default:
      return state;
  }
}

export function profileMenuSectionExpanded(state = { title: '', display: false }, action) {
  switch (action.type) {
    case 'PROFILE_MENU_SECTION_EXPANDED':
      return action.isExpanded;
    // reset on route change
    case '@@router/LOCATION_CHANGE':
      return { title: '', display: false };
    default:
      return state;
  }
}