gab-social/app/javascript/gabsocial/reducers/sidebar.js

20 lines
330 B
JavaScript
Raw Normal View History

2020-05-14 07:03:22 +01:00
import {
SIDEBAR_OPEN,
SIDEBAR_CLOSE,
} from '../actions/sidebar'
2019-08-15 04:04:03 +01:00
2020-05-14 07:03:22 +01:00
const initialState = {
open: false,
}
export default function sidebar(state = initialState, action) {
2019-08-15 04:04:03 +01:00
switch(action.type) {
case SIDEBAR_OPEN:
2020-05-14 07:03:22 +01:00
return { open: true }
2019-08-15 04:04:03 +01:00
case SIDEBAR_CLOSE:
2020-05-14 07:03:22 +01:00
return { open: false }
2019-08-15 04:04:03 +01:00
default:
2020-05-14 07:03:22 +01:00
return state
2019-08-15 04:04:03 +01:00
}
2020-05-14 07:03:22 +01:00
}