This repository has been archived on 2022-03-12. You can view files and clone it, but cannot push or open issues or pull requests.
Lateinicus/src/reducers/index.ts

27 lines
700 B
TypeScript
Raw Normal View History

2018-09-18 16:06:08 +00:00
import * as Actions from "../actions";
const initialState = {
// Show the drawer?
drawer: false,
// Should we show the button to open the drawer?
drawerButton: true,
// Is the user authenticated?
// TODO: Set this to false
authenticated: true,
};
export function LateinicusApp(state = initialState, action: any) {
switch (action.type) {
case Actions.SET_DRAWER:
return Object.assign({}, state, {
drawer: action.show,
});
case Actions.SET_DRAWER_BUTTON:
return Object.assign({}, state, {
drawerButton: action.show,
});
default:
return state;
}
};