ui: scratchpad sidebar

This commit is contained in:
undefined committed 2022-08-01 22:56:04 +08:00
1 parent 981f8a4b9d
commit e3a5543d9f
14 files changed
+239 -65

No files matched your search

@@ -11,10 +11,6 @@ export default function reducer(state = {
: false,
size: 200,
},
sidebar: {
visible: false,
size: 100,
},
records: {
visible: UiContext.canViewRecord && localStorage.getItem('scratchpad/records') === 'true',
size: 100,
@@ -23,6 +19,7 @@ export default function reducer(state = {
isPosting: false,
waitSec: 0,
isWaiting: false,
activePage: 'problem',
}, action) {
switch (action.type) {
case 'SCRATCHPAD_UI_CHANGE_SIZE': {
@@ -122,6 +119,12 @@ export default function reducer(state = {
},
};
}
case 'SCRATCHPAD_SWITCH_TO_PAGE': {
return {
...state,
activePage: action.payload,
};
}
default:
return state;
}