2022-03-11 13:00:49 +00:00
|
|
|
import {
|
|
|
|
ADD_GIF_FOR_PARTICIPANT,
|
|
|
|
HIDE_GIF_FOR_PARTICIPANT,
|
|
|
|
REMOVE_GIF_FOR_PARTICIPANT,
|
|
|
|
SET_GIF_DRAWER_VISIBILITY,
|
|
|
|
SET_GIF_MENU_VISIBILITY,
|
|
|
|
SHOW_GIF_FOR_PARTICIPANT
|
|
|
|
} from './actionTypes';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds a GIF for a given participant.
|
|
|
|
*
|
|
|
|
* @param {string} participantId - The id of the participant that sent the GIF.
|
|
|
|
* @param {string} gifUrl - The URL of the GIF.
|
|
|
|
* @returns {Object}
|
|
|
|
*/
|
2022-09-29 11:45:34 +00:00
|
|
|
export function addGif(participantId: string, gifUrl: string) {
|
2022-03-11 13:00:49 +00:00
|
|
|
return {
|
|
|
|
type: ADD_GIF_FOR_PARTICIPANT,
|
|
|
|
participantId,
|
|
|
|
gifUrl
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Removes the GIF of the given participant.
|
|
|
|
*
|
|
|
|
* @param {string} participantId - The Id of the participant for whom to remove the GIF.
|
|
|
|
* @returns {Object}
|
|
|
|
*/
|
2022-09-29 11:45:34 +00:00
|
|
|
export function removeGif(participantId: string) {
|
2022-03-11 13:00:49 +00:00
|
|
|
return {
|
|
|
|
type: REMOVE_GIF_FOR_PARTICIPANT,
|
|
|
|
participantId
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Keep showing the GIF of the given participant.
|
|
|
|
*
|
|
|
|
* @param {string} participantId - The Id of the participant for whom to show the GIF.
|
|
|
|
* @returns {Object}
|
|
|
|
*/
|
2022-09-29 11:45:34 +00:00
|
|
|
export function showGif(participantId: string) {
|
2022-03-11 13:00:49 +00:00
|
|
|
return {
|
|
|
|
type: SHOW_GIF_FOR_PARTICIPANT,
|
|
|
|
participantId
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set timeout to hide the GIF of the given participant.
|
|
|
|
*
|
|
|
|
* @param {string} participantId - The Id of the participant for whom to show the GIF.
|
|
|
|
* @returns {Object}
|
|
|
|
*/
|
2022-09-29 11:45:34 +00:00
|
|
|
export function hideGif(participantId: string) {
|
2022-03-11 13:00:49 +00:00
|
|
|
return {
|
|
|
|
type: HIDE_GIF_FOR_PARTICIPANT,
|
|
|
|
participantId
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set visibility of the GIF drawer.
|
|
|
|
*
|
|
|
|
* @param {boolean} visible - Whether or not it should be visible.
|
|
|
|
* @returns {Object}
|
|
|
|
*/
|
2022-09-29 11:45:34 +00:00
|
|
|
export function setGifDrawerVisibility(visible: boolean) {
|
2022-03-11 13:00:49 +00:00
|
|
|
return {
|
|
|
|
type: SET_GIF_DRAWER_VISIBILITY,
|
|
|
|
visible
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set visibility of the GIF menu.
|
|
|
|
*
|
|
|
|
* @param {boolean} visible - Whether or not it should be visible.
|
|
|
|
* @returns {Object}
|
|
|
|
*/
|
2022-09-29 11:45:34 +00:00
|
|
|
export function setGifMenuVisibility(visible: boolean) {
|
2022-03-11 13:00:49 +00:00
|
|
|
return {
|
|
|
|
type: SET_GIF_MENU_VISIBILITY,
|
|
|
|
visible
|
|
|
|
};
|
|
|
|
}
|