You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import React, {Component} from 'react';
|
|
|
|
import * as types from '../actions/actionTypes';
|
|
|
|
|
|
|
|
const initialState = {
|
|
|
|
isOpen: false,
|
|
|
|
refdrawer: null,
|
|
|
|
page: 'main',
|
|
|
|
subtitle: 'Calculator Page',
|
|
|
|
};
|
|
|
|
|
|
|
|
export default function menu(state = initialState, action = {}) {
|
|
|
|
switch (action.type) {
|
|
|
|
case types.MENUOPEN:
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
isOpen: true,
|
|
|
|
};
|
|
|
|
case types.MENUCLOSE:
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
isOpen: false,
|
|
|
|
};
|
|
|
|
case types.MAIN:
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
isOpen: false,
|
|
|
|
page: 'main',
|
|
|
|
subtitle: 'Calculator Page',
|
|
|
|
};
|
|
|
|
case types.HELP:
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
isOpen: false,
|
|
|
|
page: 'help',
|
|
|
|
subtitle: 'Help',
|
|
|
|
};
|
|
|
|
default:
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
}
|