2020-05-07 07:42:55 +00:00
|
|
|
import InlineDialog from '@atlaskit/inline-dialog';
|
2020-05-20 10:57:03 +00:00
|
|
|
import React, { Component } from 'react';
|
2023-01-30 11:34:56 +00:00
|
|
|
import { WithTranslation } from 'react-i18next';
|
2020-05-20 10:57:03 +00:00
|
|
|
|
2023-01-30 11:34:56 +00:00
|
|
|
import { IReduxState } from '../../../app/types';
|
|
|
|
// eslint-disable-next-line lines-around-comment
|
|
|
|
// @ts-ignore
|
2022-10-28 10:07:58 +00:00
|
|
|
import { Avatar } from '../../../base/avatar';
|
2023-01-30 11:34:56 +00:00
|
|
|
import { isNameReadOnly } from '../../../base/config/functions.web';
|
|
|
|
import { translate } from '../../../base/i18n/functions';
|
|
|
|
import { IconArrowDown, IconArrowUp, IconPhoneRinging, IconVolumeOff } from '../../../base/icons/svg';
|
|
|
|
import { isVideoMutedByUser } from '../../../base/media/functions';
|
|
|
|
import { getLocalParticipant } from '../../../base/participants/functions';
|
|
|
|
import ActionButton from '../../../base/premeeting/components/web/ActionButton';
|
|
|
|
import PreMeetingScreen from '../../../base/premeeting/components/web/PreMeetingScreen';
|
|
|
|
import { connect } from '../../../base/redux/functions';
|
|
|
|
import { updateSettings } from '../../../base/settings/actions';
|
|
|
|
import { getDisplayName } from '../../../base/settings/functions.web';
|
|
|
|
import { getLocalJitsiVideoTrack } from '../../../base/tracks/functions.web';
|
2023-01-04 12:22:51 +00:00
|
|
|
import Button from '../../../base/ui/components/web/Button';
|
2023-01-30 11:34:56 +00:00
|
|
|
import Input from '../../../base/ui/components/web/Input';
|
2023-01-04 12:22:51 +00:00
|
|
|
import { BUTTON_TYPES } from '../../../base/ui/constants.any';
|
2020-04-16 10:47:10 +00:00
|
|
|
import {
|
|
|
|
joinConference as joinConferenceAction,
|
|
|
|
joinConferenceWithoutAudio as joinConferenceWithoutAudioAction,
|
2020-05-07 07:42:55 +00:00
|
|
|
setJoinByPhoneDialogVisiblity as setJoinByPhoneDialogVisiblityAction
|
2023-01-30 11:34:56 +00:00
|
|
|
} from '../../actions.web';
|
2020-04-16 10:47:10 +00:00
|
|
|
import {
|
|
|
|
isDeviceStatusVisible,
|
2020-07-02 09:18:38 +00:00
|
|
|
isDisplayNameRequired,
|
|
|
|
isJoinByPhoneButtonVisible,
|
2022-05-26 12:38:38 +00:00
|
|
|
isJoinByPhoneDialogVisible,
|
|
|
|
isPrejoinDisplayNameVisible
|
2022-10-28 10:07:58 +00:00
|
|
|
} from '../../functions';
|
2020-05-20 10:57:03 +00:00
|
|
|
|
2023-01-30 11:34:56 +00:00
|
|
|
// @ts-ignore
|
2020-05-20 10:57:03 +00:00
|
|
|
import JoinByPhoneDialog from './dialogs/JoinByPhoneDialog';
|
2020-08-04 22:25:16 +00:00
|
|
|
|
2023-01-30 11:34:56 +00:00
|
|
|
interface IProps extends WithTranslation {
|
2020-04-16 10:47:10 +00:00
|
|
|
|
2022-05-26 12:38:38 +00:00
|
|
|
/**
|
|
|
|
* Indicates whether the display name is editable.
|
|
|
|
*/
|
2023-01-30 11:34:56 +00:00
|
|
|
canEditDisplayName: boolean;
|
2022-05-26 12:38:38 +00:00
|
|
|
|
2020-04-16 10:47:10 +00:00
|
|
|
/**
|
|
|
|
* Flag signaling if the device status is visible or not.
|
|
|
|
*/
|
2023-01-30 11:34:56 +00:00
|
|
|
deviceStatusVisible: boolean;
|
2020-04-16 10:47:10 +00:00
|
|
|
|
2020-05-19 07:52:57 +00:00
|
|
|
/**
|
|
|
|
* If join by phone button should be visible.
|
|
|
|
*/
|
2023-01-30 11:34:56 +00:00
|
|
|
hasJoinByPhoneButton: boolean;
|
2020-05-19 07:52:57 +00:00
|
|
|
|
2020-04-16 10:47:10 +00:00
|
|
|
/**
|
|
|
|
* Joins the current meeting.
|
|
|
|
*/
|
2023-01-30 11:34:56 +00:00
|
|
|
joinConference: Function;
|
2020-04-16 10:47:10 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Joins the current meeting without audio.
|
|
|
|
*/
|
2023-01-30 11:34:56 +00:00
|
|
|
joinConferenceWithoutAudio: Function;
|
2020-04-16 10:47:10 +00:00
|
|
|
|
2023-01-04 12:22:51 +00:00
|
|
|
/**
|
|
|
|
* Whether conference join is in progress.
|
|
|
|
*/
|
2023-01-30 11:34:56 +00:00
|
|
|
joiningInProgress: boolean;
|
2023-01-04 12:22:51 +00:00
|
|
|
|
2020-04-16 10:47:10 +00:00
|
|
|
/**
|
|
|
|
* The name of the user that is about to join.
|
|
|
|
*/
|
2023-01-30 11:34:56 +00:00
|
|
|
name: string;
|
2020-04-16 10:47:10 +00:00
|
|
|
|
2022-05-26 12:38:38 +00:00
|
|
|
/**
|
|
|
|
* Local participant id.
|
|
|
|
*/
|
2023-01-30 11:34:56 +00:00
|
|
|
participantId: string;
|
2022-05-26 12:38:38 +00:00
|
|
|
|
2021-12-08 07:53:19 +00:00
|
|
|
/**
|
|
|
|
* The prejoin config.
|
|
|
|
*/
|
2023-01-30 11:34:56 +00:00
|
|
|
prejoinConfig?: any;
|
2021-12-08 07:53:19 +00:00
|
|
|
|
2021-09-06 10:01:13 +00:00
|
|
|
/**
|
|
|
|
* Whether the name input should be read only or not.
|
|
|
|
*/
|
2023-01-30 11:34:56 +00:00
|
|
|
readOnlyName: boolean;
|
2021-09-06 10:01:13 +00:00
|
|
|
|
2020-05-07 07:42:55 +00:00
|
|
|
/**
|
|
|
|
* Sets visibility of the 'JoinByPhoneDialog'.
|
2020-04-16 10:47:10 +00:00
|
|
|
*/
|
2023-01-30 11:34:56 +00:00
|
|
|
setJoinByPhoneDialogVisiblity: Function;
|
2020-04-16 10:47:10 +00:00
|
|
|
|
2020-05-20 08:25:31 +00:00
|
|
|
/**
|
|
|
|
* Flag signaling the visibility of camera preview.
|
|
|
|
*/
|
2023-01-30 11:34:56 +00:00
|
|
|
showCameraPreview: boolean;
|
2020-05-20 08:25:31 +00:00
|
|
|
|
2020-08-13 09:00:20 +00:00
|
|
|
/**
|
2023-01-30 11:34:56 +00:00
|
|
|
* If 'JoinByPhoneDialog' is visible or not.
|
2020-08-13 09:00:20 +00:00
|
|
|
*/
|
2023-01-30 11:34:56 +00:00
|
|
|
showDialog: boolean;
|
2020-08-13 09:00:20 +00:00
|
|
|
|
2020-04-16 10:47:10 +00:00
|
|
|
/**
|
2023-01-30 11:34:56 +00:00
|
|
|
* If should show an error when joining without a name.
|
2020-04-16 10:47:10 +00:00
|
|
|
*/
|
2023-01-30 11:34:56 +00:00
|
|
|
showErrorOnJoin: boolean;
|
2020-04-16 10:47:10 +00:00
|
|
|
|
|
|
|
/**
|
2023-01-30 11:34:56 +00:00
|
|
|
* Updates settings.
|
2020-04-16 10:47:10 +00:00
|
|
|
*/
|
2023-01-30 11:34:56 +00:00
|
|
|
updateSettings: Function;
|
2020-05-20 08:25:31 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The JitsiLocalTrack to display.
|
|
|
|
*/
|
2023-01-30 11:34:56 +00:00
|
|
|
videoTrack?: Object;
|
|
|
|
}
|
2020-04-16 10:47:10 +00:00
|
|
|
|
2023-01-30 11:34:56 +00:00
|
|
|
interface IState {
|
2020-05-07 07:42:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Flag controlling the visibility of the 'join by phone' buttons.
|
|
|
|
*/
|
2023-01-30 11:34:56 +00:00
|
|
|
showJoinByPhoneButtons: boolean;
|
2020-05-07 07:42:55 +00:00
|
|
|
}
|
|
|
|
|
2020-04-16 10:47:10 +00:00
|
|
|
/**
|
|
|
|
* This component is displayed before joining a meeting.
|
|
|
|
*/
|
2023-01-30 11:34:56 +00:00
|
|
|
class Prejoin extends Component<IProps, IState> {
|
|
|
|
showDisplayNameField: boolean;
|
|
|
|
|
2020-04-16 10:47:10 +00:00
|
|
|
/**
|
|
|
|
* Initializes a new {@code Prejoin} instance.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
2023-01-30 11:34:56 +00:00
|
|
|
constructor(props: IProps) {
|
2020-04-16 10:47:10 +00:00
|
|
|
super(props);
|
|
|
|
|
2020-05-07 07:42:55 +00:00
|
|
|
this.state = {
|
|
|
|
showJoinByPhoneButtons: false
|
|
|
|
};
|
2020-05-14 12:30:24 +00:00
|
|
|
|
|
|
|
this._closeDialog = this._closeDialog.bind(this);
|
2020-04-16 10:47:10 +00:00
|
|
|
this._showDialog = this._showDialog.bind(this);
|
2020-08-13 09:00:20 +00:00
|
|
|
this._onJoinButtonClick = this._onJoinButtonClick.bind(this);
|
2020-05-07 07:42:55 +00:00
|
|
|
this._onDropdownClose = this._onDropdownClose.bind(this);
|
|
|
|
this._onOptionsClick = this._onOptionsClick.bind(this);
|
|
|
|
this._setName = this._setName.bind(this);
|
2021-06-10 12:48:44 +00:00
|
|
|
this._onJoinConferenceWithoutAudioKeyPress = this._onJoinConferenceWithoutAudioKeyPress.bind(this);
|
|
|
|
this._showDialogKeyPress = this._showDialogKeyPress.bind(this);
|
2021-12-08 07:53:19 +00:00
|
|
|
this._getExtraJoinButtons = this._getExtraJoinButtons.bind(this);
|
2023-01-30 11:34:56 +00:00
|
|
|
this._onInputKeyPress = this._onInputKeyPress.bind(this);
|
2022-05-26 12:38:38 +00:00
|
|
|
|
|
|
|
this.showDisplayNameField = props.canEditDisplayName || props.showErrorOnJoin;
|
2020-05-07 07:42:55 +00:00
|
|
|
}
|
2020-08-13 09:00:20 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Handler for the join button.
|
|
|
|
*
|
|
|
|
* @param {Object} e - The synthetic event.
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onJoinButtonClick() {
|
|
|
|
if (this.props.showErrorOnJoin) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
this.props.joinConference();
|
|
|
|
}
|
2020-05-07 07:42:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Closes the dropdown.
|
|
|
|
*
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onDropdownClose() {
|
|
|
|
this.setState({
|
|
|
|
showJoinByPhoneButtons: false
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Displays the join by phone buttons dropdown.
|
|
|
|
*
|
|
|
|
* @param {Object} e - The synthetic event.
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
2023-01-30 11:34:56 +00:00
|
|
|
_onOptionsClick(e?: React.KeyboardEvent | React.MouseEvent | undefined) {
|
|
|
|
e?.stopPropagation();
|
2020-05-07 07:42:55 +00:00
|
|
|
|
|
|
|
this.setState({
|
|
|
|
showJoinByPhoneButtons: !this.state.showJoinByPhoneButtons
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the guest participant name.
|
|
|
|
*
|
|
|
|
* @param {string} displayName - Participant name.
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
2023-01-30 11:34:56 +00:00
|
|
|
_setName(displayName: string) {
|
2020-05-07 07:42:55 +00:00
|
|
|
this.props.updateSettings({
|
|
|
|
displayName
|
|
|
|
});
|
2020-04-16 10:47:10 +00:00
|
|
|
}
|
|
|
|
|
2020-05-14 12:30:24 +00:00
|
|
|
/**
|
|
|
|
* Closes the join by phone dialog.
|
|
|
|
*
|
|
|
|
* @returns {undefined}
|
|
|
|
*/
|
|
|
|
_closeDialog() {
|
|
|
|
this.props.setJoinByPhoneDialogVisiblity(false);
|
|
|
|
}
|
|
|
|
|
2020-04-16 10:47:10 +00:00
|
|
|
/**
|
|
|
|
* Displays the dialog for joining a meeting by phone.
|
|
|
|
*
|
|
|
|
* @returns {undefined}
|
|
|
|
*/
|
|
|
|
_showDialog() {
|
|
|
|
this.props.setJoinByPhoneDialogVisiblity(true);
|
2020-05-14 12:30:24 +00:00
|
|
|
this._onDropdownClose();
|
2020-04-16 10:47:10 +00:00
|
|
|
}
|
|
|
|
|
2021-06-10 12:48:44 +00:00
|
|
|
/**
|
|
|
|
* KeyPress handler for accessibility.
|
|
|
|
*
|
|
|
|
* @param {Object} e - The key event to handle.
|
|
|
|
*
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
2023-01-30 11:34:56 +00:00
|
|
|
_showDialogKeyPress(e: React.KeyboardEvent) {
|
2021-06-10 12:48:44 +00:00
|
|
|
if (e.key === ' ' || e.key === 'Enter') {
|
|
|
|
e.preventDefault();
|
|
|
|
this._showDialog();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* KeyPress handler for accessibility.
|
|
|
|
*
|
|
|
|
* @param {Object} e - The key event to handle.
|
|
|
|
*
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
2023-01-30 11:34:56 +00:00
|
|
|
_onJoinConferenceWithoutAudioKeyPress(e: React.KeyboardEvent) {
|
2021-06-10 12:48:44 +00:00
|
|
|
if (this.props.joinConferenceWithoutAudio
|
|
|
|
&& (e.key === ' '
|
|
|
|
|| e.key === 'Enter')) {
|
|
|
|
e.preventDefault();
|
|
|
|
this.props.joinConferenceWithoutAudio();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-12-08 07:53:19 +00:00
|
|
|
/**
|
|
|
|
* Gets the list of extra join buttons.
|
|
|
|
*
|
|
|
|
* @returns {Object} - The list of extra buttons.
|
|
|
|
*/
|
|
|
|
_getExtraJoinButtons() {
|
|
|
|
const { joinConferenceWithoutAudio, t } = this.props;
|
|
|
|
|
|
|
|
const noAudio = {
|
|
|
|
key: 'no-audio',
|
2023-01-04 12:22:51 +00:00
|
|
|
testId: 'prejoin.joinWithoutAudio',
|
2021-12-08 07:53:19 +00:00
|
|
|
icon: IconVolumeOff,
|
|
|
|
label: t('prejoin.joinWithoutAudio'),
|
2023-01-04 12:22:51 +00:00
|
|
|
onClick: joinConferenceWithoutAudio,
|
|
|
|
onKeyPress: this._onJoinConferenceWithoutAudioKeyPress
|
2021-12-08 07:53:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const byPhone = {
|
|
|
|
key: 'by-phone',
|
2023-01-04 12:22:51 +00:00
|
|
|
testId: 'prejoin.joinByPhone',
|
2022-11-08 10:24:32 +00:00
|
|
|
icon: IconPhoneRinging,
|
2021-12-08 07:53:19 +00:00
|
|
|
label: t('prejoin.joinAudioByPhone'),
|
2023-01-04 12:22:51 +00:00
|
|
|
onClick: this._showDialog,
|
|
|
|
onKeyPress: this._showDialogKeyPress
|
2021-12-08 07:53:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
return {
|
|
|
|
noAudio,
|
|
|
|
byPhone
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2023-01-30 11:34:56 +00:00
|
|
|
/**
|
|
|
|
* Handle keypress on input.
|
|
|
|
*
|
|
|
|
* @param {KeyboardEvent} e - Keyboard event.
|
|
|
|
* @returns {void}
|
|
|
|
*/
|
|
|
|
_onInputKeyPress(e: React.KeyboardEvent) {
|
|
|
|
const { joinConference } = this.props;
|
|
|
|
|
|
|
|
if (e.key === 'Enter') {
|
|
|
|
joinConference();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-04-16 10:47:10 +00:00
|
|
|
/**
|
|
|
|
* Implements React's {@link Component#render()}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
* @returns {ReactElement}
|
|
|
|
*/
|
|
|
|
render() {
|
|
|
|
const {
|
2021-08-20 08:53:11 +00:00
|
|
|
deviceStatusVisible,
|
2020-05-19 07:52:57 +00:00
|
|
|
hasJoinByPhoneButton,
|
2020-04-16 10:47:10 +00:00
|
|
|
joinConferenceWithoutAudio,
|
2023-01-04 12:22:51 +00:00
|
|
|
joiningInProgress,
|
2020-04-16 10:47:10 +00:00
|
|
|
name,
|
2022-05-26 12:38:38 +00:00
|
|
|
participantId,
|
2021-12-08 07:53:19 +00:00
|
|
|
prejoinConfig,
|
2021-09-06 10:01:13 +00:00
|
|
|
readOnlyName,
|
2020-05-20 08:25:31 +00:00
|
|
|
showCameraPreview,
|
2020-05-14 12:30:24 +00:00
|
|
|
showDialog,
|
2023-01-04 12:22:51 +00:00
|
|
|
showErrorOnJoin,
|
2020-05-20 08:25:31 +00:00
|
|
|
t,
|
2021-08-20 08:53:11 +00:00
|
|
|
videoTrack
|
2020-04-16 10:47:10 +00:00
|
|
|
} = this.props;
|
2023-01-30 11:34:56 +00:00
|
|
|
const { _closeDialog, _onDropdownClose, _onJoinButtonClick,
|
|
|
|
_onOptionsClick, _setName, _onInputKeyPress } = this;
|
2021-12-08 07:53:19 +00:00
|
|
|
|
|
|
|
const extraJoinButtons = this._getExtraJoinButtons();
|
2023-01-30 11:34:56 +00:00
|
|
|
let extraButtonsToRender = Object.values(extraJoinButtons).filter((val: any) =>
|
2021-12-08 07:53:19 +00:00
|
|
|
!(prejoinConfig?.hideExtraJoinButtons || []).includes(val.key)
|
|
|
|
);
|
2020-05-14 12:30:24 +00:00
|
|
|
|
2021-12-08 07:53:19 +00:00
|
|
|
if (!hasJoinByPhoneButton) {
|
2023-01-30 11:34:56 +00:00
|
|
|
extraButtonsToRender = extraButtonsToRender.filter((btn: any) => btn.key !== 'by-phone');
|
2021-12-08 07:53:19 +00:00
|
|
|
}
|
|
|
|
const hasExtraJoinButtons = Boolean(extraButtonsToRender.length);
|
2023-01-04 12:22:51 +00:00
|
|
|
const { showJoinByPhoneButtons } = this.state;
|
2020-04-16 10:47:10 +00:00
|
|
|
|
|
|
|
return (
|
2020-05-20 08:25:31 +00:00
|
|
|
<PreMeetingScreen
|
2021-08-20 08:53:11 +00:00
|
|
|
showDeviceStatus = { deviceStatusVisible }
|
2020-05-20 08:25:31 +00:00
|
|
|
title = { t('prejoin.joinMeeting') }
|
|
|
|
videoMuted = { !showCameraPreview }
|
2021-08-20 08:53:11 +00:00
|
|
|
videoTrack = { videoTrack }>
|
|
|
|
<div
|
|
|
|
className = 'prejoin-input-area'
|
|
|
|
data-testid = 'prejoin.screen'>
|
2023-01-30 11:34:56 +00:00
|
|
|
{this.showDisplayNameField ? (<Input
|
2021-08-20 08:53:11 +00:00
|
|
|
autoComplete = { 'name' }
|
2022-09-19 12:57:57 +00:00
|
|
|
autoFocus = { true }
|
2023-01-30 11:34:56 +00:00
|
|
|
className = 'prejoin-input'
|
|
|
|
error = { showErrorOnJoin }
|
2021-08-20 08:53:11 +00:00
|
|
|
onChange = { _setName }
|
2023-01-30 11:34:56 +00:00
|
|
|
onKeyPress = { _onInputKeyPress }
|
|
|
|
placeholder = { t('dialog.enterDisplayName') }
|
2021-09-06 10:01:13 +00:00
|
|
|
readOnly = { readOnlyName }
|
2021-08-20 08:53:11 +00:00
|
|
|
value = { name } />
|
2022-05-26 12:38:38 +00:00
|
|
|
) : (
|
2022-06-08 10:19:08 +00:00
|
|
|
<div className = 'prejoin-avatar-container'>
|
2022-05-26 12:38:38 +00:00
|
|
|
<Avatar
|
|
|
|
className = 'prejoin-avatar'
|
|
|
|
displayName = { name }
|
|
|
|
participantId = { participantId }
|
|
|
|
size = { 72 } />
|
|
|
|
<div className = 'prejoin-avatar-name'>{name}</div>
|
2022-06-08 10:19:08 +00:00
|
|
|
</div>
|
2022-05-26 12:38:38 +00:00
|
|
|
)}
|
2021-08-20 08:53:11 +00:00
|
|
|
|
2023-01-04 12:22:51 +00:00
|
|
|
{showErrorOnJoin && <div
|
2021-08-20 08:53:11 +00:00
|
|
|
className = 'prejoin-error'
|
|
|
|
data-testid = 'prejoin.errorMessage'>{t('prejoin.errorMissingName')}</div>}
|
|
|
|
|
|
|
|
<div className = 'prejoin-preview-dropdown-container'>
|
|
|
|
<InlineDialog
|
2021-12-08 07:53:19 +00:00
|
|
|
content = { hasExtraJoinButtons && <div className = 'prejoin-preview-dropdown-btns'>
|
2023-01-30 11:34:56 +00:00
|
|
|
{extraButtonsToRender.map(({ key, ...rest }) => (
|
2023-01-04 12:22:51 +00:00
|
|
|
<Button
|
|
|
|
disabled = { joiningInProgress }
|
|
|
|
fullWidth = { true }
|
2021-12-08 07:53:19 +00:00
|
|
|
key = { key }
|
2023-01-04 12:22:51 +00:00
|
|
|
type = { BUTTON_TYPES.SECONDARY }
|
2021-12-08 07:53:19 +00:00
|
|
|
{ ...rest } />
|
|
|
|
))}
|
2021-08-20 08:53:11 +00:00
|
|
|
</div> }
|
|
|
|
isOpen = { showJoinByPhoneButtons }
|
|
|
|
onClose = { _onDropdownClose }>
|
|
|
|
<ActionButton
|
|
|
|
OptionsIcon = { showJoinByPhoneButtons ? IconArrowUp : IconArrowDown }
|
|
|
|
ariaDropDownLabel = { t('prejoin.joinWithoutAudio') }
|
|
|
|
ariaLabel = { t('prejoin.joinMeeting') }
|
|
|
|
ariaPressed = { showJoinByPhoneButtons }
|
2023-01-04 12:22:51 +00:00
|
|
|
disabled = { joiningInProgress }
|
2021-12-08 07:53:19 +00:00
|
|
|
hasOptions = { hasExtraJoinButtons }
|
2021-08-20 08:53:11 +00:00
|
|
|
onClick = { _onJoinButtonClick }
|
|
|
|
onOptionsClick = { _onOptionsClick }
|
|
|
|
role = 'button'
|
|
|
|
tabIndex = { 0 }
|
|
|
|
testId = 'prejoin.joinMeeting'
|
|
|
|
type = 'primary'>
|
|
|
|
{ t('prejoin.joinMeeting') }
|
|
|
|
</ActionButton>
|
|
|
|
</InlineDialog>
|
2020-04-16 10:47:10 +00:00
|
|
|
</div>
|
2021-08-20 08:53:11 +00:00
|
|
|
</div>
|
2020-05-14 12:30:24 +00:00
|
|
|
{ showDialog && (
|
|
|
|
<JoinByPhoneDialog
|
|
|
|
joinConferenceWithoutAudio = { joinConferenceWithoutAudio }
|
|
|
|
onClose = { _closeDialog } />
|
|
|
|
)}
|
2020-05-20 08:25:31 +00:00
|
|
|
</PreMeetingScreen>
|
2020-04-16 10:47:10 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Maps (parts of) the redux state to the React {@code Component} props.
|
|
|
|
*
|
|
|
|
* @param {Object} state - The redux state.
|
|
|
|
* @returns {Object}
|
|
|
|
*/
|
2023-01-30 11:34:56 +00:00
|
|
|
function mapStateToProps(state: IReduxState) {
|
2020-07-02 09:18:38 +00:00
|
|
|
const name = getDisplayName(state);
|
2020-08-13 09:00:20 +00:00
|
|
|
const showErrorOnJoin = isDisplayNameRequired(state) && !name;
|
2023-01-30 11:34:56 +00:00
|
|
|
const { id: participantId } = getLocalParticipant(state) ?? {};
|
2023-01-04 12:22:51 +00:00
|
|
|
const { joiningInProgress } = state['features/prejoin'];
|
2020-07-02 09:18:38 +00:00
|
|
|
|
2020-04-16 10:47:10 +00:00
|
|
|
return {
|
2022-05-26 12:38:38 +00:00
|
|
|
canEditDisplayName: isPrejoinDisplayNameVisible(state),
|
2020-04-16 10:47:10 +00:00
|
|
|
deviceStatusVisible: isDeviceStatusVisible(state),
|
2020-05-20 08:25:31 +00:00
|
|
|
hasJoinByPhoneButton: isJoinByPhoneButtonVisible(state),
|
2023-01-04 12:22:51 +00:00
|
|
|
joiningInProgress,
|
2022-05-26 12:38:38 +00:00
|
|
|
name,
|
|
|
|
participantId,
|
|
|
|
prejoinConfig: state['features/base/config'].prejoinConfig,
|
2021-11-29 23:44:31 +00:00
|
|
|
readOnlyName: isNameReadOnly(state),
|
2020-06-19 07:03:26 +00:00
|
|
|
showCameraPreview: !isVideoMutedByUser(state),
|
2022-05-26 12:38:38 +00:00
|
|
|
showDialog: isJoinByPhoneDialogVisible(state),
|
|
|
|
showErrorOnJoin,
|
|
|
|
videoTrack: getLocalJitsiVideoTrack(state)
|
2020-04-16 10:47:10 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
const mapDispatchToProps = {
|
|
|
|
joinConferenceWithoutAudio: joinConferenceWithoutAudioAction,
|
|
|
|
joinConference: joinConferenceAction,
|
|
|
|
setJoinByPhoneDialogVisiblity: setJoinByPhoneDialogVisiblityAction,
|
2020-05-07 07:42:55 +00:00
|
|
|
updateSettings
|
2020-04-16 10:47:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(translate(Prejoin));
|