|
@@ -3,11 +3,13 @@
|
3
|
3
|
import InlineDialog from '@atlaskit/inline-dialog';
|
4
|
4
|
import React, { Component } from 'react';
|
5
|
5
|
|
|
6
|
+import { Avatar } from '../../base/avatar';
|
6
|
7
|
import { getRoomName } from '../../base/conference';
|
7
|
8
|
import { isNameReadOnly } from '../../base/config';
|
8
|
9
|
import { translate } from '../../base/i18n';
|
9
|
10
|
import { IconArrowDown, IconArrowUp, IconPhone, IconVolumeOff } from '../../base/icons';
|
10
|
11
|
import { isVideoMutedByUser } from '../../base/media';
|
|
12
|
+import { getLocalParticipant } from '../../base/participants';
|
11
|
13
|
import { ActionButton, InputField, PreMeetingScreen } from '../../base/premeeting';
|
12
|
14
|
import { connect } from '../../base/redux';
|
13
|
15
|
import { getDisplayName, updateSettings } from '../../base/settings';
|
|
@@ -21,7 +23,8 @@ import {
|
21
|
23
|
isDeviceStatusVisible,
|
22
|
24
|
isDisplayNameRequired,
|
23
|
25
|
isJoinByPhoneButtonVisible,
|
24
|
|
- isJoinByPhoneDialogVisible
|
|
26
|
+ isJoinByPhoneDialogVisible,
|
|
27
|
+ isPrejoinDisplayNameVisible
|
25
|
28
|
} from '../functions';
|
26
|
29
|
|
27
|
30
|
import DropdownButton from './DropdownButton';
|
|
@@ -29,6 +32,11 @@ import JoinByPhoneDialog from './dialogs/JoinByPhoneDialog';
|
29
|
32
|
|
30
|
33
|
type Props = {
|
31
|
34
|
|
|
35
|
+ /**
|
|
36
|
+ * Indicates whether the display name is editable.
|
|
37
|
+ */
|
|
38
|
+ canEditDisplayName: boolean,
|
|
39
|
+
|
32
|
40
|
/**
|
33
|
41
|
* Flag signaling if the device status is visible or not.
|
34
|
42
|
*/
|
|
@@ -59,6 +67,11 @@ type Props = {
|
59
|
67
|
*/
|
60
|
68
|
updateSettings: Function,
|
61
|
69
|
|
|
70
|
+ /**
|
|
71
|
+ * Local participant id.
|
|
72
|
+ */
|
|
73
|
+ participantId: string,
|
|
74
|
+
|
62
|
75
|
/**
|
63
|
76
|
* The prejoin config.
|
64
|
77
|
*/
|
|
@@ -145,6 +158,8 @@ class Prejoin extends Component<Props, State> {
|
145
|
158
|
this._showDialogKeyPress = this._showDialogKeyPress.bind(this);
|
146
|
159
|
this._onJoinKeyPress = this._onJoinKeyPress.bind(this);
|
147
|
160
|
this._getExtraJoinButtons = this._getExtraJoinButtons.bind(this);
|
|
161
|
+
|
|
162
|
+ this.showDisplayNameField = props.canEditDisplayName || props.showErrorOnJoin;
|
148
|
163
|
}
|
149
|
164
|
_onJoinButtonClick: () => void;
|
150
|
165
|
|
|
@@ -330,6 +345,7 @@ class Prejoin extends Component<Props, State> {
|
330
|
345
|
joinConference,
|
331
|
346
|
joinConferenceWithoutAudio,
|
332
|
347
|
name,
|
|
348
|
+ participantId,
|
333
|
349
|
prejoinConfig,
|
334
|
350
|
readOnlyName,
|
335
|
351
|
showCameraPreview,
|
|
@@ -360,7 +376,7 @@ class Prejoin extends Component<Props, State> {
|
360
|
376
|
<div
|
361
|
377
|
className = 'prejoin-input-area'
|
362
|
378
|
data-testid = 'prejoin.screen'>
|
363
|
|
- <InputField
|
|
379
|
+ {this.showDisplayNameField ? (<InputField
|
364
|
380
|
autoComplete = { 'name' }
|
365
|
381
|
autoFocus = { true }
|
366
|
382
|
className = { showError ? 'error' : '' }
|
|
@@ -370,6 +386,16 @@ class Prejoin extends Component<Props, State> {
|
370
|
386
|
placeHolder = { t('dialog.enterDisplayName') }
|
371
|
387
|
readOnly = { readOnlyName }
|
372
|
388
|
value = { name } />
|
|
389
|
+ ) : (
|
|
390
|
+ <>
|
|
391
|
+ <Avatar
|
|
392
|
+ className = 'prejoin-avatar'
|
|
393
|
+ displayName = { name }
|
|
394
|
+ participantId = { participantId }
|
|
395
|
+ size = { 72 } />
|
|
396
|
+ <div className = 'prejoin-avatar-name'>{name}</div>
|
|
397
|
+ </>
|
|
398
|
+ )}
|
373
|
399
|
|
374
|
400
|
{showError && <div
|
375
|
401
|
className = 'prejoin-error'
|
|
@@ -423,18 +449,21 @@ class Prejoin extends Component<Props, State> {
|
423
|
449
|
function mapStateToProps(state): Object {
|
424
|
450
|
const name = getDisplayName(state);
|
425
|
451
|
const showErrorOnJoin = isDisplayNameRequired(state) && !name;
|
|
452
|
+ const { id: participantId } = getLocalParticipant(state);
|
426
|
453
|
|
427
|
454
|
return {
|
428
|
|
- name,
|
|
455
|
+ canEditDisplayName: isPrejoinDisplayNameVisible(state),
|
429
|
456
|
deviceStatusVisible: isDeviceStatusVisible(state),
|
430
|
|
- roomName: getRoomName(state),
|
431
|
|
- showDialog: isJoinByPhoneDialogVisible(state),
|
432
|
|
- showErrorOnJoin,
|
433
|
457
|
hasJoinByPhoneButton: isJoinByPhoneButtonVisible(state),
|
|
458
|
+ name,
|
|
459
|
+ participantId,
|
|
460
|
+ prejoinConfig: state['features/base/config'].prejoinConfig,
|
434
|
461
|
readOnlyName: isNameReadOnly(state),
|
|
462
|
+ roomName: getRoomName(state),
|
435
|
463
|
showCameraPreview: !isVideoMutedByUser(state),
|
436
|
|
- videoTrack: getLocalJitsiVideoTrack(state),
|
437
|
|
- prejoinConfig: state['features/base/config'].prejoinConfig
|
|
464
|
+ showDialog: isJoinByPhoneDialogVisible(state),
|
|
465
|
+ showErrorOnJoin,
|
|
466
|
+ videoTrack: getLocalJitsiVideoTrack(state)
|
438
|
467
|
};
|
439
|
468
|
}
|
440
|
469
|
|