feat(toolbox/native): custom overflow menu buttons (#14594)

* feat(toolbox/native): custom buttons for the OverflowMenu
This commit is contained in:
Calinteodor
2024-04-10 14:51:10 +03:00
committed by GitHub
parent b54cec8d77
commit 36671d7c4f
10 changed files with 172 additions and 3 deletions

View File

@@ -57,7 +57,10 @@ import { ENTER_PICTURE_IN_PICTURE } from '../picture-in-picture/actionTypes';
// @ts-ignore
import { isExternalAPIAvailable } from '../react-native-sdk/functions';
import { READY_TO_CLOSE } from './actionTypes';
import {
CUSTOM_OVERFLOW_MENU_BUTTON_PRESSED,
READY_TO_CLOSE
} from './actionTypes';
import { setParticipantsWithScreenShare } from './actions';
import { participantToParticipantInfo, sendEvent } from './functions';
import logger from './logger';
@@ -79,6 +82,12 @@ const CHAT_TOGGLED = 'CHAT_TOGGLED';
*/
const CONFERENCE_TERMINATED = 'CONFERENCE_TERMINATED';
/**
* Event which will be emitted on the native side to indicate that the custom overflow menu button was pressed.
*/
const CUSTOM_MENU_BUTTON_PRESSED = 'CUSTOM_MENU_BUTTON_PRESSED';
/**
* Event which will be emitted on the native side to indicate a message was received
* through the channel.
@@ -185,6 +194,20 @@ externalAPIEnabled && MiddlewareRegistry.register(store => next => action => {
break;
}
case CUSTOM_OVERFLOW_MENU_BUTTON_PRESSED: {
const { id, text } = action;
sendEvent(
store,
CUSTOM_MENU_BUTTON_PRESSED,
{
id,
text
});
break;
}
case ENDPOINT_MESSAGE_RECEIVED: {
const { participant, data } = action;