You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // @flow
  2. import { ReducerRegistry } from '../base/redux';
  3. import {
  4. SET_FILMSTRIP_ENABLED,
  5. SET_FILMSTRIP_HOVERED,
  6. SET_FILMSTRIP_VISIBLE
  7. } from './actionTypes';
  8. const DEFAULT_STATE = {
  9. /**
  10. * The indicator which determines whether the {@link Filmstrip} is enabled.
  11. *
  12. * @public
  13. * @type {boolean}
  14. */
  15. enabled: true,
  16. /**
  17. * The indicator which determines whether the {@link Filmstrip} is visible.
  18. *
  19. * @public
  20. * @type {boolean}
  21. */
  22. visible: true
  23. };
  24. ReducerRegistry.register(
  25. 'features/filmstrip',
  26. (state = DEFAULT_STATE, action) => {
  27. switch (action.type) {
  28. case SET_FILMSTRIP_ENABLED:
  29. return {
  30. ...state,
  31. enabled: action.enabled
  32. };
  33. case SET_FILMSTRIP_HOVERED:
  34. return {
  35. ...state,
  36. /**
  37. * The indicator which determines whether the {@link Filmstrip}
  38. * is being hovered (over).
  39. *
  40. * @public
  41. * @type {boolean}
  42. */
  43. hovered: action.hovered
  44. };
  45. case SET_FILMSTRIP_VISIBLE:
  46. return {
  47. ...state,
  48. visible: action.visible
  49. };
  50. }
  51. return state;
  52. });