bigbuffet-rw/app/soapbox/reducers/sidebar.ts

23 lines
468 B
TypeScript
Raw Normal View History

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 {
switch (action.type) {
2020-03-27 13:59:38 -07:00
case SIDEBAR_OPEN:
return { sidebarOpen: true };
case SIDEBAR_CLOSE:
return { sidebarOpen: false };
default:
return state;
}
2021-08-03 12:22:51 -07:00
}