diff --git a/react/features/mobile/external-api/actionTypes.ts b/react/features/mobile/external-api/actionTypes.ts index a672e62177e39..8f1964170db92 100644 --- a/react/features/mobile/external-api/actionTypes.ts +++ b/react/features/mobile/external-api/actionTypes.ts @@ -18,14 +18,3 @@ export const READY_TO_CLOSE = 'READY_TO_CLOSE'; */ export const SCREEN_SHARE_PARTICIPANTS_UPDATED = 'SCREEN_SHARE_PARTICIPANTS_UPDATED'; - -/** - * The type of (redux) action which signals that a custom button from the overflow menu was pressed. - * - * @returns {{ - * type: CUSTOM_OVERFLOW_MENU_BUTTON_PRESSED, - * id: string, - * text: string - * }} - */ -export const CUSTOM_OVERFLOW_MENU_BUTTON_PRESSED = 'CUSTOM_OVERFLOW_MENU_BUTTON_PRESSED'; diff --git a/react/features/mobile/external-api/actions.ts b/react/features/mobile/external-api/actions.ts index 7614062e222c4..d9f951583acd9 100644 --- a/react/features/mobile/external-api/actions.ts +++ b/react/features/mobile/external-api/actions.ts @@ -1,8 +1,4 @@ -import { - CUSTOM_OVERFLOW_MENU_BUTTON_PRESSED, - READY_TO_CLOSE, - SCREEN_SHARE_PARTICIPANTS_UPDATED -} from './actionTypes'; +import { READY_TO_CLOSE, SCREEN_SHARE_PARTICIPANTS_UPDATED } from './actionTypes'; /** @@ -35,22 +31,3 @@ export function setParticipantsWithScreenShare(participantIds: Array) { participantIds }; } - -/** - * Creates a (redux) action which that a custom overflow menu button was pressed. - * - * @param {string} id - The id for the custom button. - * @param {string} text - The label for the custom button. - * @returns {{ - * type: CUSTOM_OVERFLOW_MENU_BUTTON_PRESSED, - * id: string, - * text: string - * }} - */ -export function customOverflowMenuButtonPressed(id: string, text: string) { - return { - type: CUSTOM_OVERFLOW_MENU_BUTTON_PRESSED, - id, - text - }; -} diff --git a/react/features/mobile/external-api/middleware.ts b/react/features/mobile/external-api/middleware.ts index 7c1c1f6798dd2..2ddf5d9fd6196 100644 --- a/react/features/mobile/external-api/middleware.ts +++ b/react/features/mobile/external-api/middleware.ts @@ -52,15 +52,13 @@ import { ITrack } from '../../base/tracks/types'; import { CLOSE_CHAT, OPEN_CHAT } from '../../chat/actionTypes'; import { closeChat, openChat, sendMessage, setPrivateMessageRecipient } from '../../chat/actions.native'; import { setRequestingSubtitles } from '../../subtitles/actions.any'; +import { CUSTOM_OVERFLOW_MENU_BUTTON_PRESSED } from '../../toolbox/actionTypes'; import { muteLocal } from '../../video-menu/actions.native'; import { ENTER_PICTURE_IN_PICTURE } from '../picture-in-picture/actionTypes'; // @ts-ignore import { isExternalAPIAvailable } from '../react-native-sdk/functions'; -import { - CUSTOM_OVERFLOW_MENU_BUTTON_PRESSED, - READY_TO_CLOSE -} from './actionTypes'; +import { READY_TO_CLOSE } from './actionTypes'; import { setParticipantsWithScreenShare } from './actions'; import { participantToParticipantInfo, sendEvent } from './functions'; import logger from './logger'; @@ -82,12 +80,6 @@ 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. @@ -199,7 +191,7 @@ externalAPIEnabled && MiddlewareRegistry.register(store => next => action => { sendEvent( store, - CUSTOM_MENU_BUTTON_PRESSED, + CUSTOM_OVERFLOW_MENU_BUTTON_PRESSED, { id, text diff --git a/react/features/toolbox/actionTypes.ts b/react/features/toolbox/actionTypes.ts index a594298df701c..7803a1169e2c6 100644 --- a/react/features/toolbox/actionTypes.ts +++ b/react/features/toolbox/actionTypes.ts @@ -7,6 +7,17 @@ */ export const CLEAR_TOOLBOX_TIMEOUT = 'CLEAR_TOOLBOX_TIMEOUT'; +/** + * The type of (redux) action which signals that a custom button from the overflow menu was pressed. + * + * @returns {{ + * type: CUSTOM_OVERFLOW_MENU_BUTTON_PRESSED, + * id: string, + * text: string + * }} + */ +export const CUSTOM_OVERFLOW_MENU_BUTTON_PRESSED = 'CUSTOM_OVERFLOW_MENU_BUTTON_PRESSED'; + /** * The type of (redux) action which updates whether the conference is or is not * currently in full screen view. diff --git a/react/features/toolbox/actions.native.ts b/react/features/toolbox/actions.native.ts index 7f84c5637ffad..568d9320c22b8 100644 --- a/react/features/toolbox/actions.native.ts +++ b/react/features/toolbox/actions.native.ts @@ -1,3 +1,5 @@ +import { CUSTOM_OVERFLOW_MENU_BUTTON_PRESSED } from './actionTypes'; + export * from './actions.any'; /** @@ -22,3 +24,22 @@ export function showToolbox(_timeout?: number): any { export function setOverflowMenuVisible(_visible: boolean): any { return {}; } + +/** + * Creates a (redux) action which that a custom overflow menu button was pressed. + * + * @param {string} id - The id for the custom button. + * @param {string} text - The label for the custom button. + * @returns {{ + * type: CUSTOM_OVERFLOW_MENU_BUTTON_PRESSED, + * id: string, + * text: string + * }} + */ +export function customOverflowMenuButtonPressed(id: string, text: string) { + return { + type: CUSTOM_OVERFLOW_MENU_BUTTON_PRESSED, + id, + text + }; +} diff --git a/react/features/toolbox/components/native/OverflowMenu.tsx b/react/features/toolbox/components/native/OverflowMenu.tsx index 480ba5dbeca46..4186a434744a0 100644 --- a/react/features/toolbox/components/native/OverflowMenu.tsx +++ b/react/features/toolbox/components/native/OverflowMenu.tsx @@ -11,7 +11,6 @@ import SettingsButton from '../../../base/settings/components/native/SettingsBut import BreakoutRoomsButton from '../../../breakout-rooms/components/native/BreakoutRoomsButton'; import SharedDocumentButton from '../../../etherpad/components/SharedDocumentButton.native'; -import { customOverflowMenuButtonPressed } from '../../../mobile/external-api/actions'; import ReactionMenu from '../../../reactions/components/native/ReactionMenu'; import { shouldDisplayReactionsButtons } from '../../../reactions/functions.any'; import LiveStreamButton from '../../../recording/components/LiveStream/native/LiveStreamButton'; @@ -25,6 +24,7 @@ import ClosedCaptionButton from '../../../subtitles/components/native/ClosedCapt import TileViewButton from '../../../video-layout/components/TileViewButton'; import styles from '../../../video-menu/components/native/styles'; import WhiteboardButton from '../../../whiteboard/components/native/WhiteboardButton'; +import { customOverflowMenuButtonPressed } from '../../actions.native'; import { getMovableButtons } from '../../functions.native'; import AudioOnlyButton from './AudioOnlyButton';