diff --git a/react/features/lobby/actions.any.js b/react/features/lobby/actions.any.js index 75f6f5b89..6ae4745a7 100644 --- a/react/features/lobby/actions.any.js +++ b/react/features/lobby/actions.any.js @@ -23,3 +23,24 @@ export function toggleLobbyMode(enabled: boolean) { } }; } + +/** + * Approves (lets in) or rejects a knocking participant. + * + * @param {string} id - The id of the knocking participant. + * @param {boolean} approved - True if the participant is approved, false otherwise. + * @returns {Function} + */ +export function setKnockingParticipantApproval(id: string, approved: boolean) { + return async (dispatch: Dispatch, getState: Function) => { + const conference = getCurrentConference(getState); + + if (conference) { + if (approved) { + conference.lobbyApproveAccess(id); + } else { + conference.lobbyDenyAccess(id); + } + } + }; +} diff --git a/react/features/lobby/actions.native.js b/react/features/lobby/actions.native.js index 19f68c808..b35b46839 100644 --- a/react/features/lobby/actions.native.js +++ b/react/features/lobby/actions.native.js @@ -5,6 +5,7 @@ import { openDialog } from '../base/dialog'; import { DisableLobbyModeDialog, EnableLobbyModeDialog } from './components/native'; export * from './actions.web'; +export * from './actions.any'; /** * Action to show the dialog to disable lobby mode. diff --git a/react/features/participants-pane/actions.js b/react/features/participants-pane/actions.any.js similarity index 100% rename from react/features/participants-pane/actions.js rename to react/features/participants-pane/actions.any.js diff --git a/react/features/participants-pane/actions.native.js b/react/features/participants-pane/actions.native.js new file mode 100644 index 000000000..7e5279fe7 --- /dev/null +++ b/react/features/participants-pane/actions.native.js @@ -0,0 +1,3 @@ +// @flow + +export * from './actions.any'; diff --git a/react/features/participants-pane/actions.web.js b/react/features/participants-pane/actions.web.js new file mode 100644 index 000000000..7e5279fe7 --- /dev/null +++ b/react/features/participants-pane/actions.web.js @@ -0,0 +1,3 @@ +// @flow + +export * from './actions.any'; diff --git a/react/features/participants-pane/components/native/LobbyParticipantItem.js b/react/features/participants-pane/components/native/LobbyParticipantItem.js index e7c3ef443..ec4671d8d 100644 --- a/react/features/participants-pane/components/native/LobbyParticipantItem.js +++ b/react/features/participants-pane/components/native/LobbyParticipantItem.js @@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next'; import { Button } from 'react-native-paper'; import { useDispatch } from 'react-redux'; -// import { setKnockingParticipantApproval } from '../../../lobby/actions'; +import { setKnockingParticipantApproval } from '../../../lobby/actions.native'; import { MediaState } from '../../constants'; import ParticipantItem from './ParticipantItem'; diff --git a/react/features/participants-pane/components/native/ParticipantItem.js b/react/features/participants-pane/components/native/ParticipantItem.js index fa2af329f..7ac3a813c 100644 --- a/react/features/participants-pane/components/native/ParticipantItem.js +++ b/react/features/participants-pane/components/native/ParticipantItem.js @@ -8,8 +8,12 @@ import { useSelector } from 'react-redux'; import { Avatar } from '../../../base/avatar'; import { getParticipantDisplayNameWithId } from '../../../base/participants'; -import { ActionTrigger, MediaState } from '../../constants'; -// import { AudioStateIcons, VideoStateIcons } from '../web/ParticipantItem'; +import { + ActionTrigger, + AudioStateIcons, + MediaState, + VideoStateIcons +} from '../../constants'; import { RaisedHandIndicator } from './RaisedHandIndicator'; import styles from './styles'; diff --git a/react/features/participants-pane/components/native/ParticipantsPane.js b/react/features/participants-pane/components/native/ParticipantsPane.js index be3b18ede..6fbaf375f 100644 --- a/react/features/participants-pane/components/native/ParticipantsPane.js +++ b/react/features/participants-pane/components/native/ParticipantsPane.js @@ -9,7 +9,7 @@ import { useDispatch, useSelector } from 'react-redux'; import { IconClose, IconHorizontalPoints } from '../../../base/icons'; import { JitsiModal } from '../../../base/modal'; import { isLocalParticipantModerator } from '../../../base/participants'; -import { close } from '../../actions'; +import { close } from '../../actions.native'; import Button from './Button'; import { LobbyParticipantList } from './LobbyParticipantList';