2020-03-27 13:59:38 -07:00
|
|
|
import { SIDEBAR_OPEN, SIDEBAR_CLOSE } from '../actions/sidebar';
|
|
|
|
|
2022-04-12 17:52:20 -07:00
|
|
|
import type { AnyAction } from 'redux';
|
|
|
|
|
|
|
|
type State = {
|
|
|
|
sidebarOpen: boolean,
|
|
|
|
};
|
|
|
|
|
|
|
|
const initialState: State = {
|
|
|
|
sidebarOpen: false,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default function sidebar(state: State = initialState, action: AnyAction): State {
|
2020-03-27 13:59:38 -07:00
|
|
|
switch(action.type) {
|
|
|
|
case SIDEBAR_OPEN:
|
|
|
|
return { sidebarOpen: true };
|
|
|
|
case SIDEBAR_CLOSE:
|
|
|
|
return { sidebarOpen: false };
|
|
|
|
default:
|
|
|
|
return state;
|
|
|
|
}
|
2021-08-03 12:22:51 -07:00
|
|
|
}
|