jiti-meet/react/features/base/responsive-ui/reducer.js

29 lines
706 B
JavaScript
Raw Normal View History

// @flow
import { ReducerRegistry, set } from '../redux';
import { SET_ASPECT_RATIO, SET_REDUCED_UI } from './actionTypes';
import { ASPECT_RATIO_NARROW } from './constants';
2017-11-07 14:28:08 +00:00
/**
* The default/initial redux state of the feature base/responsive-ui.
2017-11-07 14:28:08 +00:00
*/
const DEFAULT_STATE = {
aspectRatio: ASPECT_RATIO_NARROW,
reducedUI: false
};
ReducerRegistry.register(
'features/base/responsive-ui',
(state = DEFAULT_STATE, action) => {
2017-11-07 14:28:08 +00:00
switch (action.type) {
case SET_ASPECT_RATIO:
return set(state, 'aspectRatio', action.aspectRatio);
case SET_REDUCED_UI:
return set(state, 'reducedUI', action.reducedUI);
2017-11-07 14:28:08 +00:00
}
2017-11-07 14:28:08 +00:00
return state;
});