選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

actions.native.js 2.0KB

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