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.web.js 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // @flow
  2. import { openDialog } from '../base/dialog/actions';
  3. import { SharedVideoDialog } from '../shared-video/components';
  4. import { SET_SHARED_VIDEO_STATUS, TOGGLE_SHARED_VIDEO, SET_DISABLE_BUTTON } from './actionTypes';
  5. /**
  6. * Updates the current known status of the shared video.
  7. *
  8. * @param {string} status - The current status of the video being shared.
  9. * @returns {{
  10. * type: SET_SHARED_VIDEO_STATUS,
  11. * status: string
  12. * }}
  13. */
  14. export function setSharedVideoStatus(status: string) {
  15. return {
  16. type: SET_SHARED_VIDEO_STATUS,
  17. status
  18. };
  19. }
  20. /**
  21. * Disabled share video button.
  22. *
  23. * @param {boolean} disabled - The current state of the share video button.
  24. * @returns {{
  25. * type: SET_DISABLE_BUTTON,
  26. * disabled: boolean
  27. * }}
  28. */
  29. export function setDisableButton(disabled: boolean) {
  30. return {
  31. type: SET_DISABLE_BUTTON,
  32. disabled
  33. };
  34. }
  35. /**
  36. * Starts the flow for starting or stopping a shared video.
  37. *
  38. * @returns {{
  39. * type: TOGGLE_SHARED_VIDEO
  40. * }}
  41. */
  42. export function toggleSharedVideo() {
  43. return {
  44. type: TOGGLE_SHARED_VIDEO
  45. };
  46. }
  47. /**
  48. * Displays the dialog for entering the video link.
  49. *
  50. * @param {Function} onPostSubmit - The function to be invoked when a valid link is entered.
  51. * @returns {Function}
  52. */
  53. export function showSharedVideoDialog(onPostSubmit: ?Function) {
  54. return openDialog(SharedVideoDialog, { onPostSubmit });
  55. }