const defState = () => ({
    showMenu: false,
    showLoading: false,
    showDashboard: false
})
const uiReducer = (state = defState(), action) => {
    switch (action.type) {
        case 'ui_show_menu':
            return {...state, showMenu: true };
        case 'ui_hide_menu':
            return {...state, showMenu: false };
        case 'ui_show_loading':
            return {...state, showLoading: true};
        case 'ui_hide_loading':
            return {...state, showLoading: false};
        case 'ui_show_dashboard':
            return {...state, showDashboard: true};
        case 'ui_hide_dashboard':
            return {...state, showDashboard: false};
        default:
            return state;
    }
}

export default uiReducer;