bigbuffet-rw/app/soapbox/reducers/sidebar.ts
marcin mikołajczak 81de0014d3 Change ESLint rules, lint
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2023-02-16 00:12:02 +01:00

22 lines
479 B
TypeScript

import { SIDEBAR_OPEN, SIDEBAR_CLOSE } from '../actions/sidebar';
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) {
case SIDEBAR_OPEN:
return { sidebarOpen: true };
case SIDEBAR_CLOSE:
return { sidebarOpen: false };
default:
return state;
}
}