mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 03:12:29 +00:00
Show GIF menu in reactions menu Search GIFs using the GIPHY API Show GIFs as images in chat Show GIFs on the thumbnail of the participant that sent it Move GIF focus using up/ down arrows and send with Enter Added analytics
74 lines
1.7 KiB
JavaScript
74 lines
1.7 KiB
JavaScript
|
|
import { ReducerRegistry } from '../base/redux';
|
|
|
|
import {
|
|
ADD_GIF_FOR_PARTICIPANT,
|
|
HIDE_GIF_FOR_PARTICIPANT,
|
|
REMOVE_GIF_FOR_PARTICIPANT,
|
|
SET_GIF_DRAWER_VISIBILITY,
|
|
SET_GIF_MENU_VISIBILITY
|
|
} from './actionTypes';
|
|
|
|
const initialState = {
|
|
drawerVisible: false,
|
|
gifList: new Map(),
|
|
menuOpen: false
|
|
};
|
|
|
|
ReducerRegistry.register(
|
|
'features/gifs',
|
|
(state = initialState, action) => {
|
|
switch (action.type) {
|
|
case ADD_GIF_FOR_PARTICIPANT: {
|
|
const newList = state.gifList;
|
|
|
|
newList.set(action.participantId, {
|
|
gifUrl: action.gifUrl,
|
|
timeoutID: action.timeoutID
|
|
});
|
|
|
|
return {
|
|
...state,
|
|
gifList: newList
|
|
};
|
|
}
|
|
case REMOVE_GIF_FOR_PARTICIPANT: {
|
|
const newList = state.gifList;
|
|
|
|
newList.delete(action.participantId);
|
|
|
|
return {
|
|
...state,
|
|
gifList: newList
|
|
};
|
|
}
|
|
case HIDE_GIF_FOR_PARTICIPANT: {
|
|
const newList = state.gifList;
|
|
const gif = state.gifList.get(action.participantId);
|
|
|
|
newList.set(action.participantId, {
|
|
gifUrl: gif.gifUrl,
|
|
timeoutID: action.timeoutID
|
|
});
|
|
|
|
return {
|
|
...state,
|
|
gifList: newList
|
|
};
|
|
}
|
|
case SET_GIF_DRAWER_VISIBILITY:
|
|
return {
|
|
...state,
|
|
drawerVisible: action.visible
|
|
};
|
|
case SET_GIF_MENU_VISIBILITY:
|
|
return {
|
|
...state,
|
|
menuOpen: action.visible
|
|
};
|
|
}
|
|
|
|
return state;
|
|
});
|
|
|