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.

actions.native.js 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // @flow
  2. import {
  3. SET_FILMSTRIP_ENABLED,
  4. SET_FILMSTRIP_VISIBLE,
  5. SET_TILE_VIEW_DIMENSIONS
  6. } from './actionTypes';
  7. /**
  8. * Sets whether the filmstrip is enabled.
  9. *
  10. * @param {boolean} enabled - Whether the filmstrip is enabled.
  11. * @returns {{
  12. * type: SET_FILMSTRIP_ENABLED,
  13. * enabled: boolean
  14. * }}
  15. */
  16. export function setFilmstripEnabled(enabled: boolean) {
  17. return {
  18. type: SET_FILMSTRIP_ENABLED,
  19. enabled
  20. };
  21. }
  22. /**
  23. * Sets whether the filmstrip is visible.
  24. *
  25. * @param {boolean} visible - Whether the filmstrip is visible.
  26. * @returns {{
  27. * type: SET_FILMSTRIP_VISIBLE,
  28. * visible: boolean
  29. * }}
  30. */
  31. export function setFilmstripVisible(visible: boolean) {
  32. return {
  33. type: SET_FILMSTRIP_VISIBLE,
  34. visible
  35. };
  36. }
  37. /**
  38. * Sets the dimensions of the tile view grid. The action is only partially implemented on native as not all
  39. * of the values are currently used. Check the description of {@link SET_TILE_VIEW_DIMENSIONS} for the full set
  40. * of properties.
  41. *
  42. * @param {Object} dimensions - The tile view dimensions.
  43. * @param {Object} thumbnailSize - The size of an individual video thumbnail.
  44. * @param {number} thumbnailSize.height - The height of an individual video thumbnail.
  45. * @param {number} thumbnailSize.width - The width of an individual video thumbnail.
  46. * @returns {{
  47. * type: SET_TILE_VIEW_DIMENSIONS,
  48. * dimensions: Object
  49. * }}
  50. */
  51. export function setTileViewDimensions({ thumbnailSize }: Object) {
  52. return {
  53. type: SET_TILE_VIEW_DIMENSIONS,
  54. dimensions: {
  55. thumbnailSize
  56. }
  57. };
  58. }