feat(native-participants-pane) separated native actions from web actions and created any actions for the common ones

This commit is contained in:
Calin Chitu 2021-05-19 13:42:30 +03:00 committed by Hristo Terezov
parent 79edc1b358
commit 8b44e06f2c
8 changed files with 36 additions and 4 deletions

View File

@ -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<any>, getState: Function) => {
const conference = getCurrentConference(getState);
if (conference) {
if (approved) {
conference.lobbyApproveAccess(id);
} else {
conference.lobbyDenyAccess(id);
}
}
};
}

View File

@ -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.

View File

@ -0,0 +1,3 @@
// @flow
export * from './actions.any';

View File

@ -0,0 +1,3 @@
// @flow
export * from './actions.any';

View File

@ -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';

View File

@ -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';

View File

@ -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';