|
@@ -2,14 +2,21 @@
|
2
|
2
|
|
3
|
3
|
import React, { PureComponent } from 'react';
|
4
|
4
|
|
|
5
|
+import { connect } from '../../../../base/redux';
|
5
|
6
|
import DeviceStatus from '../../../../prejoin/components/preview/DeviceStatus';
|
6
|
7
|
import { Toolbox } from '../../../../toolbox/components/web';
|
|
8
|
+import { PREMEETING_BUTTONS, THIRD_PARTY_PREJOIN_BUTTONS } from '../../../config/constants';
|
7
|
9
|
|
8
|
10
|
import ConnectionStatus from './ConnectionStatus';
|
9
|
11
|
import Preview from './Preview';
|
10
|
12
|
|
11
|
13
|
type Props = {
|
12
|
14
|
|
|
15
|
+ /**
|
|
16
|
+ * The list of toolbar buttons to render.
|
|
17
|
+ */
|
|
18
|
+ _buttons: Array<string>,
|
|
19
|
+
|
13
|
20
|
/**
|
14
|
21
|
* Children component(s) to be rendered on the screen.
|
15
|
22
|
*/
|
|
@@ -46,9 +53,9 @@ type Props = {
|
46
|
53
|
title?: string,
|
47
|
54
|
|
48
|
55
|
/**
|
49
|
|
- * Override for default toolbar buttons
|
|
56
|
+ * Whether it's used in the 3rdParty prejoin screen or not.
|
50
|
57
|
*/
|
51
|
|
- toolbarButtons?: Array<string>,
|
|
58
|
+ thirdParty?: boolean,
|
52
|
59
|
|
53
|
60
|
/**
|
54
|
61
|
* True if the preview overlay should be muted, false otherwise.
|
|
@@ -61,13 +68,11 @@ type Props = {
|
61
|
68
|
videoTrack?: Object
|
62
|
69
|
}
|
63
|
70
|
|
64
|
|
-const buttons = [ 'microphone', 'camera', 'select-background', 'invite', 'settings' ];
|
65
|
|
-
|
66
|
71
|
/**
|
67
|
72
|
* Implements a pre-meeting screen that can be used at various pre-meeting phases, for example
|
68
|
73
|
* on the prejoin screen (pre-connection) or lobby (post-connection).
|
69
|
74
|
*/
|
70
|
|
-export default class PreMeetingScreen extends PureComponent<Props> {
|
|
75
|
+class PreMeetingScreen extends PureComponent<Props> {
|
71
|
76
|
/**
|
72
|
77
|
* Default values for {@code Prejoin} component's properties.
|
73
|
78
|
*
|
|
@@ -85,12 +90,12 @@ export default class PreMeetingScreen extends PureComponent<Props> {
|
85
|
90
|
*/
|
86
|
91
|
render() {
|
87
|
92
|
const {
|
|
93
|
+ _buttons,
|
88
|
94
|
children,
|
89
|
95
|
className,
|
90
|
96
|
showDeviceStatus,
|
91
|
97
|
skipPrejoinButton,
|
92
|
98
|
title,
|
93
|
|
- toolbarButtons,
|
94
|
99
|
videoMuted,
|
95
|
100
|
videoTrack
|
96
|
101
|
} = this.props;
|
|
@@ -107,7 +112,7 @@ export default class PreMeetingScreen extends PureComponent<Props> {
|
107
|
112
|
{ title }
|
108
|
113
|
</h1>
|
109
|
114
|
{ children }
|
110
|
|
- <Toolbox toolbarButtons = { toolbarButtons || buttons } />
|
|
115
|
+ { _buttons.length && <Toolbox toolbarButtons = { _buttons } /> }
|
111
|
116
|
{ skipPrejoinButton }
|
112
|
117
|
{ showDeviceStatus && <DeviceStatus /> }
|
113
|
118
|
</div>
|
|
@@ -120,3 +125,24 @@ export default class PreMeetingScreen extends PureComponent<Props> {
|
120
|
125
|
);
|
121
|
126
|
}
|
122
|
127
|
}
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+/**
|
|
131
|
+ * Maps (parts of) the redux state to the React {@code Component} props.
|
|
132
|
+ *
|
|
133
|
+ * @param {Object} state - The redux state.
|
|
134
|
+ * @param {Object} ownProps - The props passed to the component.
|
|
135
|
+ * @returns {Object}
|
|
136
|
+ */
|
|
137
|
+function mapStateToProps(state, ownProps): Object {
|
|
138
|
+ const hideButtons = state['features/base/config'].hiddenPremeetingButtons || [];
|
|
139
|
+ const premeetingButtons = ownProps.thirdParty
|
|
140
|
+ ? THIRD_PARTY_PREJOIN_BUTTONS
|
|
141
|
+ : PREMEETING_BUTTONS;
|
|
142
|
+
|
|
143
|
+ return {
|
|
144
|
+ _buttons: premeetingButtons.filter(b => !hideButtons.includes(b))
|
|
145
|
+ };
|
|
146
|
+}
|
|
147
|
+
|
|
148
|
+export default connect(mapStateToProps)(PreMeetingScreen);
|