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.js 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. import {
  2. ADD_GIF_FOR_PARTICIPANT,
  3. HIDE_GIF_FOR_PARTICIPANT,
  4. REMOVE_GIF_FOR_PARTICIPANT,
  5. SET_GIF_DRAWER_VISIBILITY,
  6. SET_GIF_MENU_VISIBILITY,
  7. SHOW_GIF_FOR_PARTICIPANT
  8. } from './actionTypes';
  9. /**
  10. * Adds a GIF for a given participant.
  11. *
  12. * @param {string} participantId - The id of the participant that sent the GIF.
  13. * @param {string} gifUrl - The URL of the GIF.
  14. * @returns {Object}
  15. */
  16. export function addGif(participantId, gifUrl) {
  17. return {
  18. type: ADD_GIF_FOR_PARTICIPANT,
  19. participantId,
  20. gifUrl
  21. };
  22. }
  23. /**
  24. * Removes the GIF of the given participant.
  25. *
  26. * @param {string} participantId - The Id of the participant for whom to remove the GIF.
  27. * @returns {Object}
  28. */
  29. export function removeGif(participantId) {
  30. return {
  31. type: REMOVE_GIF_FOR_PARTICIPANT,
  32. participantId
  33. };
  34. }
  35. /**
  36. * Keep showing the GIF of the given participant.
  37. *
  38. * @param {string} participantId - The Id of the participant for whom to show the GIF.
  39. * @returns {Object}
  40. */
  41. export function showGif(participantId) {
  42. return {
  43. type: SHOW_GIF_FOR_PARTICIPANT,
  44. participantId
  45. };
  46. }
  47. /**
  48. * Set timeout to hide the GIF of the given participant.
  49. *
  50. * @param {string} participantId - The Id of the participant for whom to show the GIF.
  51. * @returns {Object}
  52. */
  53. export function hideGif(participantId) {
  54. return {
  55. type: HIDE_GIF_FOR_PARTICIPANT,
  56. participantId
  57. };
  58. }
  59. /**
  60. * Set visibility of the GIF drawer.
  61. *
  62. * @param {boolean} visible - Whether or not it should be visible.
  63. * @returns {Object}
  64. */
  65. export function setGifDrawerVisibility(visible) {
  66. return {
  67. type: SET_GIF_DRAWER_VISIBILITY,
  68. visible
  69. };
  70. }
  71. /**
  72. * Set visibility of the GIF menu.
  73. *
  74. * @param {boolean} visible - Whether or not it should be visible.
  75. * @returns {Object}
  76. */
  77. export function setGifMenuVisibility(visible) {
  78. return {
  79. type: SET_GIF_MENU_VISIBILITY,
  80. visible
  81. };
  82. }