Start adding toggle to open/close sidebar

This commit is contained in:
Erik Ziegler committed 2018-12-19 09:41:30 +01:00
1 parent 4174018149
commit c08d12cb36
7 files changed
+48 -26

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
const defaultState = {
sidebarLeftOpen: true,
sidebarRightOpen: true,
}
const ui = (state = defaultState, action) => {
switch (action.type) {
case 'TOGGLE_LEFT_SIDEBAR':
return Object.assign({}, state, { sidebarLeftOpen: !state.sidebarLeftOpen });
case 'TOGGLE_RIGHT_SIDEBAR':
return Object.assign({}, state, { sidebarRightOpen: !state.sidebarRightOpen });
default:
return state;
}
};
export default ui;