( state, action )
| 18 | } |
| 19 | |
| 20 | const sidePanelDataReducer: Reducer<SidePanelState, SidePanelAction> = ( |
| 21 | state, |
| 22 | action |
| 23 | ) => { |
| 24 | switch (action.type) { |
| 25 | case 'ShowRoot': { |
| 26 | return { |
| 27 | visible: true, |
| 28 | mode: 'mobile', |
| 29 | activeId: ROOT, |
| 30 | } |
| 31 | } |
| 32 | case 'ShowSection': { |
| 33 | return { |
| 34 | visible: true, |
| 35 | mode: action.mode, |
| 36 | activeId: action.id, |
| 37 | } |
| 38 | } |
| 39 | case 'Hide': |
| 40 | default: { |
| 41 | return { |
| 42 | ...state, |
| 43 | visible: false, |
| 44 | } |
| 45 | } |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | const defaultState: SidePanelState = { |
| 50 | visible: false, |
nothing calls this directly
no outgoing calls
no test coverage detected