2018-02-12 17:42:38 +00:00
|
|
|
// @flow
|
|
|
|
|
2017-05-23 18:58:07 +00:00
|
|
|
import { ReducerRegistry } from '../base/redux';
|
2018-02-05 21:52:41 +00:00
|
|
|
|
2018-02-06 09:40:16 +00:00
|
|
|
import {
|
|
|
|
SET_FILMSTRIP_ENABLED,
|
|
|
|
SET_FILMSTRIP_HOVERED,
|
|
|
|
SET_FILMSTRIP_VISIBLE
|
|
|
|
} from './actionTypes';
|
2017-05-23 18:58:07 +00:00
|
|
|
|
|
|
|
const DEFAULT_STATE = {
|
2018-02-12 17:42:38 +00:00
|
|
|
/**
|
|
|
|
* The indicator which determines whether the {@link Filmstrip} is enabled.
|
|
|
|
*
|
|
|
|
* @public
|
|
|
|
* @type {boolean}
|
|
|
|
*/
|
2018-02-06 09:40:16 +00:00
|
|
|
enabled: true,
|
2018-02-12 17:42:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The indicator which determines whether the {@link Filmstrip} is visible.
|
|
|
|
*
|
|
|
|
* @public
|
|
|
|
* @type {boolean}
|
|
|
|
*/
|
2017-05-23 18:58:07 +00:00
|
|
|
visible: true
|
|
|
|
};
|
|
|
|
|
|
|
|
ReducerRegistry.register(
|
|
|
|
'features/filmstrip',
|
|
|
|
(state = DEFAULT_STATE, action) => {
|
|
|
|
switch (action.type) {
|
2018-02-06 09:40:16 +00:00
|
|
|
case SET_FILMSTRIP_ENABLED:
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
enabled: action.enabled
|
|
|
|
};
|
|
|
|
|
2017-09-01 21:40:05 +00:00
|
|
|
case SET_FILMSTRIP_HOVERED:
|
|
|
|
return {
|
|
|
|
...state,
|
2018-02-12 17:42:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The indicator which determines whether the {@link Filmstrip}
|
|
|
|
* is being hovered (over).
|
|
|
|
*
|
|
|
|
* @public
|
|
|
|
* @type {boolean}
|
|
|
|
*/
|
2017-09-01 21:40:05 +00:00
|
|
|
hovered: action.hovered
|
|
|
|
};
|
|
|
|
|
2018-02-05 21:52:41 +00:00
|
|
|
case SET_FILMSTRIP_VISIBLE:
|
2017-05-23 18:58:07 +00:00
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
visible: action.visible
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
return state;
|
|
|
|
});
|