|
|
|
@ -3,11 +3,13 @@ |
|
|
|
|
import InlineDialog from '@atlaskit/inline-dialog'; |
|
|
|
|
import React, { Component } from 'react'; |
|
|
|
|
|
|
|
|
|
import { Avatar } from '../../base/avatar'; |
|
|
|
|
import { getRoomName } from '../../base/conference'; |
|
|
|
|
import { isNameReadOnly } from '../../base/config'; |
|
|
|
|
import { translate } from '../../base/i18n'; |
|
|
|
|
import { IconArrowDown, IconArrowUp, IconPhone, IconVolumeOff } from '../../base/icons'; |
|
|
|
|
import { isVideoMutedByUser } from '../../base/media'; |
|
|
|
|
import { getLocalParticipant } from '../../base/participants'; |
|
|
|
|
import { ActionButton, InputField, PreMeetingScreen } from '../../base/premeeting'; |
|
|
|
|
import { connect } from '../../base/redux'; |
|
|
|
|
import { getDisplayName, updateSettings } from '../../base/settings'; |
|
|
|
@ -21,7 +23,8 @@ import { |
|
|
|
|
isDeviceStatusVisible, |
|
|
|
|
isDisplayNameRequired, |
|
|
|
|
isJoinByPhoneButtonVisible, |
|
|
|
|
isJoinByPhoneDialogVisible |
|
|
|
|
isJoinByPhoneDialogVisible, |
|
|
|
|
isPrejoinDisplayNameVisible |
|
|
|
|
} from '../functions'; |
|
|
|
|
|
|
|
|
|
import DropdownButton from './DropdownButton'; |
|
|
|
@ -29,6 +32,11 @@ import JoinByPhoneDialog from './dialogs/JoinByPhoneDialog'; |
|
|
|
|
|
|
|
|
|
type Props = { |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Indicates whether the display name is editable. |
|
|
|
|
*/ |
|
|
|
|
canEditDisplayName: boolean, |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Flag signaling if the device status is visible or not. |
|
|
|
|
*/ |
|
|
|
@ -59,6 +67,11 @@ type Props = { |
|
|
|
|
*/ |
|
|
|
|
updateSettings: Function, |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Local participant id. |
|
|
|
|
*/ |
|
|
|
|
participantId: string, |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* The prejoin config. |
|
|
|
|
*/ |
|
|
|
@ -145,6 +158,8 @@ class Prejoin extends Component<Props, State> { |
|
|
|
|
this._showDialogKeyPress = this._showDialogKeyPress.bind(this); |
|
|
|
|
this._onJoinKeyPress = this._onJoinKeyPress.bind(this); |
|
|
|
|
this._getExtraJoinButtons = this._getExtraJoinButtons.bind(this); |
|
|
|
|
|
|
|
|
|
this.showDisplayNameField = props.canEditDisplayName || props.showErrorOnJoin; |
|
|
|
|
} |
|
|
|
|
_onJoinButtonClick: () => void; |
|
|
|
|
|
|
|
|
@ -330,6 +345,7 @@ class Prejoin extends Component<Props, State> { |
|
|
|
|
joinConference, |
|
|
|
|
joinConferenceWithoutAudio, |
|
|
|
|
name, |
|
|
|
|
participantId, |
|
|
|
|
prejoinConfig, |
|
|
|
|
readOnlyName, |
|
|
|
|
showCameraPreview, |
|
|
|
@ -360,7 +376,7 @@ class Prejoin extends Component<Props, State> { |
|
|
|
|
<div |
|
|
|
|
className = 'prejoin-input-area' |
|
|
|
|
data-testid = 'prejoin.screen'> |
|
|
|
|
<InputField |
|
|
|
|
{this.showDisplayNameField ? (<InputField |
|
|
|
|
autoComplete = { 'name' } |
|
|
|
|
autoFocus = { true } |
|
|
|
|
className = { showError ? 'error' : '' } |
|
|
|
@ -370,6 +386,16 @@ class Prejoin extends Component<Props, State> { |
|
|
|
|
placeHolder = { t('dialog.enterDisplayName') } |
|
|
|
|
readOnly = { readOnlyName } |
|
|
|
|
value = { name } /> |
|
|
|
|
) : ( |
|
|
|
|
<> |
|
|
|
|
<Avatar |
|
|
|
|
className = 'prejoin-avatar' |
|
|
|
|
displayName = { name } |
|
|
|
|
participantId = { participantId } |
|
|
|
|
size = { 72 } /> |
|
|
|
|
<div className = 'prejoin-avatar-name'>{name}</div> |
|
|
|
|
</> |
|
|
|
|
)} |
|
|
|
|
|
|
|
|
|
{showError && <div |
|
|
|
|
className = 'prejoin-error' |
|
|
|
@ -423,18 +449,21 @@ class Prejoin extends Component<Props, State> { |
|
|
|
|
function mapStateToProps(state): Object { |
|
|
|
|
const name = getDisplayName(state); |
|
|
|
|
const showErrorOnJoin = isDisplayNameRequired(state) && !name; |
|
|
|
|
const { id: participantId } = getLocalParticipant(state); |
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
name, |
|
|
|
|
canEditDisplayName: isPrejoinDisplayNameVisible(state), |
|
|
|
|
deviceStatusVisible: isDeviceStatusVisible(state), |
|
|
|
|
roomName: getRoomName(state), |
|
|
|
|
showDialog: isJoinByPhoneDialogVisible(state), |
|
|
|
|
showErrorOnJoin, |
|
|
|
|
hasJoinByPhoneButton: isJoinByPhoneButtonVisible(state), |
|
|
|
|
name, |
|
|
|
|
participantId, |
|
|
|
|
prejoinConfig: state['features/base/config'].prejoinConfig, |
|
|
|
|
readOnlyName: isNameReadOnly(state), |
|
|
|
|
roomName: getRoomName(state), |
|
|
|
|
showCameraPreview: !isVideoMutedByUser(state), |
|
|
|
|
videoTrack: getLocalJitsiVideoTrack(state), |
|
|
|
|
prejoinConfig: state['features/base/config'].prejoinConfig |
|
|
|
|
showDialog: isJoinByPhoneDialogVisible(state), |
|
|
|
|
showErrorOnJoin, |
|
|
|
|
videoTrack: getLocalJitsiVideoTrack(state) |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|