Просмотр исходного кода

feat(overlays): CallOverlay is not really an overlay

It's not supposed to go on top of everything, like an error would. It's tied to
a conference, so render it outside of the OverlayContainer.
master
Saúl Ibarra Corretgé 7 лет назад
Родитель
Сommit
0f6243ee88

+ 4
- 4
react/features/base/jwt/actionTypes.js Просмотреть файл

1
 /**
1
 /**
2
- * The type of redux action which sets the visibility of {@code CallOverlay}.
2
+ * The type of redux action which sets the visibility of {@code CalleeInfo}.
3
  *
3
  *
4
  * {
4
  * {
5
- *     type: SET_CALL_OVERLAY_VISIBLE,
6
- *     callOverlayVisible: boolean
5
+ *     type: SET_CALLEE_INFO_VISIBLE,
6
+ *     calleeInfoVisible: boolean
7
  * }
7
  * }
8
  */
8
  */
9
-export const SET_CALL_OVERLAY_VISIBLE = Symbol('SET_CALL_OVERLAY_VISIBLE');
9
+export const SET_CALLEE_INFO_VISIBLE = Symbol('SET_CALLEE_INFO_VISIBLE');
10
 
10
 
11
 /**
11
 /**
12
  * The type of redux action which stores a specific JSON Web Token (JWT) into
12
  * The type of redux action which stores a specific JSON Web Token (JWT) into

+ 9
- 9
react/features/base/jwt/actions.js Просмотреть файл

1
 // @flow
1
 // @flow
2
 
2
 
3
-import { SET_CALL_OVERLAY_VISIBLE, SET_JWT } from './actionTypes';
3
+import { SET_CALLEE_INFO_VISIBLE, SET_JWT } from './actionTypes';
4
 
4
 
5
 /**
5
 /**
6
- * Sets the visibility of {@code CallOverlay}.
6
+ * Sets the visibility of {@code CalleeInfo}.
7
  *
7
  *
8
- * @param {boolean|undefined} [callOverlayVisible] - If {@code CallOverlay} is
8
+ * @param {boolean|undefined} [calleeInfoVisible] - If {@code CalleeInfo} is
9
  * to be displayed/visible, then {@code true}; otherwise, {@code false} or
9
  * to be displayed/visible, then {@code true}; otherwise, {@code false} or
10
  * {@code undefined}.
10
  * {@code undefined}.
11
  * @returns {{
11
  * @returns {{
12
- *     type: SET_CALL_OVERLAY_VISIBLE,
13
- *     callOverlayVisible: (boolean|undefined)
12
+ *     type: SET_CALLEE_INFO_VISIBLE,
13
+ *     calleeInfoVisible: (boolean|undefined)
14
  * }}
14
  * }}
15
  */
15
  */
16
-export function setCallOverlayVisible(callOverlayVisible: ?boolean) {
16
+export function setCalleeInfoVisible(calleeInfoVisible: ?boolean) {
17
     return (dispatch: Dispatch<*>, getState: Function) => {
17
     return (dispatch: Dispatch<*>, getState: Function) => {
18
         getState()['features/base/jwt']
18
         getState()['features/base/jwt']
19
-            .callOverlayVisible === callOverlayVisible
19
+            .calleeInfoVisible === calleeInfoVisible
20
             || dispatch({
20
             || dispatch({
21
-                type: SET_CALL_OVERLAY_VISIBLE,
22
-                callOverlayVisible
21
+                type: SET_CALLEE_INFO_VISIBLE,
22
+                calleeInfoVisible
23
             });
23
             });
24
     };
24
     };
25
 }
25
 }

react/features/base/jwt/components/CallOverlay.js → react/features/base/jwt/components/CalleeInfo.js Просмотреть файл

1
 // @flow
1
 // @flow
2
 
2
 
3
-import PropTypes from 'prop-types';
4
 import React, { Component } from 'react';
3
 import React, { Component } from 'react';
5
 import { connect } from 'react-redux';
4
 import { connect } from 'react-redux';
6
 
5
 
16
 declare var interfaceConfig: Object;
15
 declare var interfaceConfig: Object;
17
 
16
 
18
 /**
17
 /**
19
- * Implements a React {@link Component} which depicts the establishment of a
20
- * call with a specific remote callee.
21
- *
22
- * @extends Component
18
+ * The type of the React {@code Component} props of {@link CalleeInfo}.
19
+ */
20
+type Props = {
21
+
22
+    /**
23
+     * Object containing the callee's information.
24
+     */
25
+    _callee: Object
26
+}
27
+
28
+/**
29
+ * The type of the React {@code Component} state of {@link CalleeInfo}.
23
  */
30
  */
24
-class CallOverlay extends Component<*, *> {
31
+type State = {
32
+
25
     /**
33
     /**
26
-     * {@code CallOverlay} component's property types.
34
+     * The CSS class (name), if any, to add to this {@code CalleeInfo}.
27
      *
35
      *
28
-     * @static
36
+     * @type {string}
29
      */
37
      */
30
-    static propTypes = {
31
-        _callee: PropTypes.object
32
-    };
38
+    className: ?string,
33
 
39
 
34
     /**
40
     /**
35
-     * Determines whether this overlay needs to be rendered (according to a
36
-     * specific redux state). Called by {@link OverlayContainer}.
41
+     * The indicator which determines whether this {@code CalleeInfo}
42
+     * should play/render audio to indicate the ringing phase of the
43
+     * call establishment between the local participant and the
44
+     * associated remote callee.
37
      *
45
      *
38
-     * @param {Object} state - The redux state.
39
-     * @returns {boolean} - If this overlay needs to be rendered, {@code true};
40
-     * {@code false}, otherwise.
46
+     * @type {boolean}
41
      */
47
      */
42
-    static needsRender(state) {
43
-        return state['features/base/jwt'].callOverlayVisible;
44
-    }
48
+    renderAudio: boolean,
45
 
49
 
50
+    /**
51
+     * The indicator which determines whether this {@code CalleeInfo}
52
+     * is depicting the ringing phase of the call establishment between
53
+     * the local participant and the associated remote callee or the
54
+     * phase afterwards when the callee has not answered the call for a
55
+     * period of time and, consequently, is considered unavailable.
56
+     *
57
+     * @type {boolean}
58
+     */
59
+    ringing: boolean
60
+}
61
+
62
+/**
63
+ * Implements a React {@link Component} which depicts the establishment of a
64
+ * call with a specific remote callee.
65
+ *
66
+ * @extends Component
67
+ */
68
+class CalleeInfo extends Component<Props, State> {
46
     /**
69
     /**
47
      * The (reference to the) {@link Audio} which plays/renders the audio
70
      * The (reference to the) {@link Audio} which plays/renders the audio
48
      * depicting the ringing phase of the call establishment represented by this
71
      * depicting the ringing phase of the call establishment represented by this
49
-     * {@code CallOverlay}.
72
+     * {@code CalleeInfo}.
50
      */
73
      */
51
-    _audio: ?Audio
74
+    _audio: ?Audio;
52
 
75
 
53
-    _onLargeVideoAvatarVisible: Function
76
+    _onLargeVideoAvatarVisible: Function;
54
 
77
 
55
-    _playAudioInterval: ?number
78
+    _playAudioInterval: ?number;
56
 
79
 
57
     _ringingTimeout: ?number
80
     _ringingTimeout: ?number
58
 
81
 
59
-    _setAudio: Function
60
-
61
-    state: {
62
-
63
-        /**
64
-         * The CSS class (name), if any, to add to this {@code CallOverlay}.
65
-         *
66
-         * @type {string}
67
-         */
68
-        className: ?string,
69
-
70
-        /**
71
-         * The indicator which determines whether this {@code CallOverlay}
72
-         * should play/render audio to indicate the ringing phase of the
73
-         * call establishment between the local participant and the
74
-         * associated remote callee.
75
-         *
76
-         * @type {boolean}
77
-         */
78
-        renderAudio: boolean,
79
-
80
-        /**
81
-         * The indicator which determines whether this {@code CallOverlay}
82
-         * is depicting the ringing phase of the call establishment between
83
-         * the local participant and the associated remote callee or the
84
-         * phase afterwards when the callee has not answered the call for a
85
-         * period of time and, consequently, is considered unavailable.
86
-         *
87
-         * @type {boolean}
88
-         */
89
-        ringing: boolean
90
-    }
82
+    _setAudio: Function;
91
 
83
 
92
     /**
84
     /**
93
-     * Initializes a new {@code CallOverlay} instance.
85
+     * Initializes a new {@code CalleeInfo} instance.
94
      *
86
      *
95
      * @param {Object} props - The read-only React {@link Component} props with
87
      * @param {Object} props - The read-only React {@link Component} props with
96
      * which the new instance is to be initialized.
88
      * which the new instance is to be initialized.
119
 
111
 
120
     /**
112
     /**
121
      * Sets up timeouts such as the timeout to end the ringing phase of the call
113
      * Sets up timeouts such as the timeout to end the ringing phase of the call
122
-     * establishment depicted by this {@code CallOverlay}.
114
+     * establishment depicted by this {@code CalleeInfo}.
123
      *
115
      *
124
      * @inheritdoc
116
      * @inheritdoc
125
      */
117
      */
126
     componentDidMount() {
118
     componentDidMount() {
127
         // Set up the timeout to end the ringing phase of the call establishment
119
         // Set up the timeout to end the ringing phase of the call establishment
128
-        // depicted by this CallOverlay.
120
+        // depicted by this CalleeInfo.
129
         if (this.state.ringing && !this._ringingTimeout) {
121
         if (this.state.ringing && !this._ringingTimeout) {
130
             this._ringingTimeout
122
             this._ringingTimeout
131
                 = setTimeout(
123
                 = setTimeout(
200
     }
192
     }
201
 
193
 
202
     /**
194
     /**
203
-     * Notifies this {@code CallOverlay} that the visibility of the
195
+     * Notifies this {@code CalleeInfo} that the visibility of the
204
      * participant's avatar in the large video has changed.
196
      * participant's avatar in the large video has changed.
205
      *
197
      *
206
      * @param {boolean} largeVideoAvatarVisible - If the avatar in the large
198
      * @param {boolean} largeVideoAvatarVisible - If the avatar in the large
217
 
209
 
218
     /**
210
     /**
219
      * Stops the playback of the audio which represents the ringing phase of the
211
      * Stops the playback of the audio which represents the ringing phase of the
220
-     * call establishment depicted by this {@code CallOverlay}.
212
+     * call establishment depicted by this {@code CalleeInfo}.
221
      *
213
      *
222
      * @private
214
      * @private
223
      * @returns {void}
215
      * @returns {void}
236
 
228
 
237
     /**
229
     /**
238
      * Starts the playback of the audio which represents the ringing phase of
230
      * Starts the playback of the audio which represents the ringing phase of
239
-     * the call establishment depicted by this {@code CallOverlay}.
231
+     * the call establishment depicted by this {@code CalleeInfo}.
240
      *
232
      *
241
      * @private
233
      * @private
242
      * @returns {void}
234
      * @returns {void}
253
 
245
 
254
     /**
246
     /**
255
      * Renders an audio element to represent the ringing phase of the call
247
      * Renders an audio element to represent the ringing phase of the call
256
-     * establishment represented by this {@code CallOverlay}.
248
+     * establishment represented by this {@code CalleeInfo}.
257
      *
249
      *
258
      * @private
250
      * @private
259
      * @returns {ReactElement}
251
      * @returns {ReactElement}
272
 
264
 
273
     /**
265
     /**
274
      * Sets the (reference to the) {@link Audio} which renders the ringing phase
266
      * Sets the (reference to the) {@link Audio} which renders the ringing phase
275
-     * of the call establishment represented by this {@code CallOverlay}.
267
+     * of the call establishment represented by this {@code CalleeInfo}.
276
      *
268
      *
277
      * @param {Audio} audio - The (reference to the) {@code Audio} which
269
      * @param {Audio} audio - The (reference to the) {@code Audio} which
278
      * plays/renders the audio depicting the ringing phase of the call
270
      * plays/renders the audio depicting the ringing phase of the call
279
-     * establishment represented by this {@code CallOverlay}.
271
+     * establishment represented by this {@code CalleeInfo}.
280
      * @private
272
      * @private
281
      * @returns {void}
273
      * @returns {void}
282
      */
274
      */
332
 }
324
 }
333
 
325
 
334
 /**
326
 /**
335
- * Maps (parts of) the redux state to {@code CallOverlay}'s props.
327
+ * Maps (parts of) the redux state to {@code CalleeInfo}'s props.
336
  *
328
  *
337
  * @param {Object} state - The redux state.
329
  * @param {Object} state - The redux state.
338
  * @private
330
  * @private
351
     };
343
     };
352
 }
344
 }
353
 
345
 
354
-export default connect(_mapStateToProps)(CallOverlay);
346
+export default connect(_mapStateToProps)(CalleeInfo);

+ 1
- 1
react/features/base/jwt/components/index.js Просмотреть файл

1
-export { default as CallOverlay } from './CallOverlay';
1
+export { default as CalleeInfo } from './CalleeInfo';

+ 2
- 2
react/features/base/jwt/components/styles.native.js Просмотреть файл

5
     // with the existing CSS class names on Web.
5
     // with the existing CSS class names on Web.
6
 
6
 
7
     /**
7
     /**
8
-     * The style of {@code CallOverlay}.
8
+     * The style of {@code CalleeInfo}.
9
      */
9
      */
10
     ringing: {
10
     ringing: {
11
         alignItems: 'center',
11
         alignItems: 'center',
43
     },
43
     },
44
 
44
 
45
     /**
45
     /**
46
-     * The style of {@code Text} within {@code CallOverlay}.
46
+     * The style of {@code Text} within {@code CalleeInfo}.
47
      */
47
      */
48
     'ringing__text': {
48
     'ringing__text': {
49
         color: ColorPalette.white
49
         color: ColorPalette.white

+ 14
- 14
react/features/base/jwt/middleware.js Просмотреть файл

19
 } from '../participants';
19
 } from '../participants';
20
 import { MiddlewareRegistry } from '../redux';
20
 import { MiddlewareRegistry } from '../redux';
21
 
21
 
22
-import { setCallOverlayVisible, setJWT } from './actions';
22
+import { setCalleeInfoVisible, setJWT } from './actions';
23
 import { SET_JWT } from './actionTypes';
23
 import { SET_JWT } from './actionTypes';
24
 import { parseJWTFromURLParams } from './functions';
24
 import { parseJWTFromURLParams } from './functions';
25
 
25
 
40
     case LIB_INIT_ERROR:
40
     case LIB_INIT_ERROR:
41
     case PARTICIPANT_JOINED:
41
     case PARTICIPANT_JOINED:
42
     case SET_ROOM:
42
     case SET_ROOM:
43
-        return _maybeSetCallOverlayVisible(store, next, action);
43
+        return _maybeSetCalleeInfoVisible(store, next, action);
44
 
44
 
45
     case SET_CONFIG:
45
     case SET_CONFIG:
46
     case SET_LOCATION_URL:
46
     case SET_LOCATION_URL:
61
 /**
61
 /**
62
  * Notifies the feature jwt that a specific {@code action} is being dispatched
62
  * Notifies the feature jwt that a specific {@code action} is being dispatched
63
  * within a specific redux {@code store} which may have an effect on the
63
  * within a specific redux {@code store} which may have an effect on the
64
- * visiblity of (the) {@code CallOverlay}.
64
+ * visiblity of (the) {@code CalleeInfo}.
65
  *
65
  *
66
  * @param {Store} store - The redux store in which the specified {@code action}
66
  * @param {Store} store - The redux store in which the specified {@code action}
67
  * is being dispatched.
67
  * is being dispatched.
73
  * @returns {Object} The new state that is the result of the reduction of the
73
  * @returns {Object} The new state that is the result of the reduction of the
74
  * specified {@code action}.
74
  * specified {@code action}.
75
  */
75
  */
76
-function _maybeSetCallOverlayVisible({ dispatch, getState }, next, action) {
76
+function _maybeSetCalleeInfoVisible({ dispatch, getState }, next, action) {
77
     const result = next(action);
77
     const result = next(action);
78
 
78
 
79
     const state = getState();
79
     const state = getState();
80
     const stateFeaturesJWT = state['features/base/jwt'];
80
     const stateFeaturesJWT = state['features/base/jwt'];
81
-    let callOverlayVisible;
81
+    let calleeInfoVisible;
82
 
82
 
83
     if (stateFeaturesJWT.callee) {
83
     if (stateFeaturesJWT.callee) {
84
         const { conference, leaving, room } = state['features/base/conference'];
84
         const { conference, leaving, room } = state['features/base/conference'];
85
 
85
 
86
-        // XXX The CallOverlay is to be displayed/visible as soon as possible
86
+        // XXX The CalleeInfo is to be displayed/visible as soon as possible
87
         // including even before the conference is joined.
87
         // including even before the conference is joined.
88
         if (room && (!conference || conference !== leaving)) {
88
         if (room && (!conference || conference !== leaving)) {
89
             switch (action.type) {
89
             switch (action.type) {
91
             case CONFERENCE_LEFT:
91
             case CONFERENCE_LEFT:
92
             case CONFERENCE_WILL_LEAVE:
92
             case CONFERENCE_WILL_LEAVE:
93
             case LIB_INIT_ERROR:
93
             case LIB_INIT_ERROR:
94
-                // Because the CallOverlay is to be displayed/visible as soon as
94
+                // Because the CalleeInfo is to be displayed/visible as soon as
95
                 // possible even before the connection is established and/or the
95
                 // possible even before the connection is established and/or the
96
                 // conference is joined, it is very complicated to figure out
96
                 // conference is joined, it is very complicated to figure out
97
                 // based on the current state alone. In order to reduce the
97
                 // based on the current state alone. In order to reduce the
103
                 break;
103
                 break;
104
 
104
 
105
             default: {
105
             default: {
106
-                // The CallOverlay is to no longer be displayed/visible as soon
106
+                // The CalleeInfo is to no longer be displayed/visible as soon
107
                 // as another participant joins.
107
                 // as another participant joins.
108
-                callOverlayVisible
108
+                calleeInfoVisible
109
                     = getParticipantCount(state) === 1
109
                     = getParticipantCount(state) === 1
110
                         && Boolean(getLocalParticipant(state));
110
                         && Boolean(getLocalParticipant(state));
111
 
111
 
112
                 // However, the CallDialog is not to be displayed/visible again
112
                 // However, the CallDialog is not to be displayed/visible again
113
                 // after all remote participants leave.
113
                 // after all remote participants leave.
114
-                if (callOverlayVisible
115
-                        && stateFeaturesJWT.callOverlayVisible === false) {
116
-                    callOverlayVisible = false;
114
+                if (calleeInfoVisible
115
+                        && stateFeaturesJWT.calleeInfoVisible === false) {
116
+                    calleeInfoVisible = false;
117
                 }
117
                 }
118
                 break;
118
                 break;
119
             }
119
             }
120
             }
120
             }
121
         }
121
         }
122
     }
122
     }
123
-    dispatch(setCallOverlayVisible(callOverlayVisible));
123
+    dispatch(setCalleeInfoVisible(calleeInfoVisible));
124
 
124
 
125
     return result;
125
     return result;
126
 }
126
 }
240
         }
240
         }
241
     }
241
     }
242
 
242
 
243
-    return _maybeSetCallOverlayVisible(store, next, action);
243
+    return _maybeSetCalleeInfoVisible(store, next, action);
244
 }
244
 }
245
 
245
 
246
 /**
246
 /**

+ 6
- 6
react/features/base/jwt/reducer.js Просмотреть файл

2
 
2
 
3
 import { equals, set, ReducerRegistry } from '../redux';
3
 import { equals, set, ReducerRegistry } from '../redux';
4
 
4
 
5
-import { SET_CALL_OVERLAY_VISIBLE, SET_JWT } from './actionTypes';
5
+import { SET_CALLEE_INFO_VISIBLE, SET_JWT } from './actionTypes';
6
 
6
 
7
 /**
7
 /**
8
  * The initial redux state of the feature jwt.
8
  * The initial redux state of the feature jwt.
9
  *
9
  *
10
  * @private
10
  * @private
11
  * @type {{
11
  * @type {{
12
- *     callOverlayVisible: ?boolean
12
+ *     calleeInfoVisible: ?boolean
13
  *     isGuest: boolean
13
  *     isGuest: boolean
14
  * }}
14
  * }}
15
  */
15
  */
16
 const _INITIAL_STATE = {
16
 const _INITIAL_STATE = {
17
     /**
17
     /**
18
-     * The indicator which determines whether (the) {@code CallOverlay} is
18
+     * The indicator which determines whether (the) {@code CalleeInfo} is
19
      * visible.
19
      * visible.
20
      *
20
      *
21
      * @type {boolean|undefined}
21
      * @type {boolean|undefined}
22
      */
22
      */
23
-    callOverlayVisible: undefined,
23
+    calleeInfoVisible: undefined,
24
 
24
 
25
     /**
25
     /**
26
      * The indicator which determines whether the local participant is a guest
26
      * The indicator which determines whether the local participant is a guest
44
     'features/base/jwt',
44
     'features/base/jwt',
45
     (state = _INITIAL_STATE, action) => {
45
     (state = _INITIAL_STATE, action) => {
46
         switch (action.type) {
46
         switch (action.type) {
47
-        case SET_CALL_OVERLAY_VISIBLE:
48
-            return set(state, 'callOverlayVisible', action.callOverlayVisible);
47
+        case SET_CALLEE_INFO_VISIBLE:
48
+            return set(state, 'calleeInfoVisible', action.calleeInfoVisible);
49
 
49
 
50
         case SET_JWT: {
50
         case SET_JWT: {
51
             // eslint-disable-next-line no-unused-vars
51
             // eslint-disable-next-line no-unused-vars

+ 20
- 0
react/features/conference/components/Conference.native.js Просмотреть файл

9
 import { appNavigate } from '../../app';
9
 import { appNavigate } from '../../app';
10
 import { connect, disconnect } from '../../base/connection';
10
 import { connect, disconnect } from '../../base/connection';
11
 import { DialogContainer } from '../../base/dialog';
11
 import { DialogContainer } from '../../base/dialog';
12
+import { CalleeInfo } from '../../base/jwt';
12
 import { Container, LoadingIndicator } from '../../base/react';
13
 import { Container, LoadingIndicator } from '../../base/react';
13
 import { createDesiredLocalTracks } from '../../base/tracks';
14
 import { createDesiredLocalTracks } from '../../base/tracks';
14
 import { Filmstrip } from '../../filmstrip';
15
 import { Filmstrip } from '../../filmstrip';
15
 import { LargeVideo } from '../../large-video';
16
 import { LargeVideo } from '../../large-video';
16
 import { setToolboxVisible, Toolbox } from '../../toolbox';
17
 import { setToolboxVisible, Toolbox } from '../../toolbox';
17
 
18
 
19
+import { abstractMapStateToProps } from '../functions';
20
+
18
 import styles from './styles';
21
 import styles from './styles';
19
 
22
 
20
 /**
23
 /**
30
  */
33
  */
31
 type Props = {
34
 type Props = {
32
 
35
 
36
+    /**
37
+     * The indication which determines if the {@code CalleeInfo} component
38
+     * should be shown or not.
39
+     *
40
+     * @private
41
+     */
42
+    _calleeInfoVisible: boolean,
43
+
33
     /**
44
     /**
34
      * The indicator which determines that we are still connecting to the
45
      * The indicator which determines that we are still connecting to the
35
      * conference which includes establishing the XMPP connection and then
46
      * conference which includes establishing the XMPP connection and then
189
                   */}
200
                   */}
190
                 <LargeVideo />
201
                 <LargeVideo />
191
 
202
 
203
+                {/*
204
+                  * If there is a ringing call, show the callee's info.
205
+                  */
206
+                    this.props._calleeInfoVisible
207
+                        && <CalleeInfo />
208
+                }
209
+
192
                 {/*
210
                 {/*
193
                   * The activity/loading indicator goes above everything, except
211
                   * The activity/loading indicator goes above everything, except
194
                   * the toolbox/toolbars and the dialogs.
212
                   * the toolbox/toolbars and the dialogs.
375
         = connecting || (connection && (joining || (!conference && !leaving)));
393
         = connecting || (connection && (joining || (!conference && !leaving)));
376
 
394
 
377
     return {
395
     return {
396
+        ...abstractMapStateToProps(state),
397
+
378
         /**
398
         /**
379
          * The indicator which determines that we are still connecting to the
399
          * The indicator which determines that we are still connecting to the
380
          * conference which includes establishing the XMPP connection and then
400
          * conference which includes establishing the XMPP connection and then

+ 35
- 18
react/features/conference/components/Conference.web.js Просмотреть файл

1
-/* @flow */
1
+// @flow
2
 
2
 
3
 import _ from 'lodash';
3
 import _ from 'lodash';
4
-import PropTypes from 'prop-types';
5
 import React, { Component } from 'react';
4
 import React, { Component } from 'react';
6
 import { connect as reactReduxConnect } from 'react-redux';
5
 import { connect as reactReduxConnect } from 'react-redux';
7
 
6
 
8
 import { connect, disconnect } from '../../base/connection';
7
 import { connect, disconnect } from '../../base/connection';
9
 import { DialogContainer } from '../../base/dialog';
8
 import { DialogContainer } from '../../base/dialog';
9
+import { CalleeInfo } from '../../base/jwt';
10
 import { Filmstrip } from '../../filmstrip';
10
 import { Filmstrip } from '../../filmstrip';
11
 import { LargeVideo } from '../../large-video';
11
 import { LargeVideo } from '../../large-video';
12
 import { NotificationsContainer } from '../../notifications';
12
 import { NotificationsContainer } from '../../notifications';
13
 import { showToolbox, Toolbox } from '../../toolbox';
13
 import { showToolbox, Toolbox } from '../../toolbox';
14
 import { HideNotificationBarStyle } from '../../unsupported-browser';
14
 import { HideNotificationBarStyle } from '../../unsupported-browser';
15
 
15
 
16
-declare var $: Function;
16
+import { abstractMapStateToProps } from '../functions';
17
+
17
 declare var APP: Object;
18
 declare var APP: Object;
18
 declare var interfaceConfig: Object;
19
 declare var interfaceConfig: Object;
19
 
20
 
20
 /**
21
 /**
21
- * The conference page of the Web application.
22
+ * The type of the React {@code Component} props of {@link Conference}.
22
  */
23
  */
23
-class Conference extends Component<*> {
24
-    _onShowToolbar: Function;
25
-    _originalOnShowToolbar: Function;
24
+type Props = {
26
 
25
 
27
     /**
26
     /**
28
-     * Conference component's property types.
29
-     *
30
-     * @static
27
+     * Whether or not the callee's info for a ringing call should be shown
28
+     * or not.
31
      */
29
      */
32
-    static propTypes = {
33
-        /**
34
-         * Whether or not the current local user is recording the conference.
35
-         *
36
-         */
37
-        _isRecording: PropTypes.bool,
30
+    _calleeInfoVisible: boolean,
38
 
31
 
39
-        dispatch: PropTypes.func
40
-    };
32
+    /**
33
+     * Whether or not the current local user is recording the conference.
34
+     */
35
+    _isRecording: boolean,
36
+
37
+    dispatch: Function
38
+}
39
+
40
+/**
41
+ * The conference page of the Web application.
42
+ */
43
+class Conference extends Component<Props> {
44
+    _onShowToolbar: Function;
45
+    _originalOnShowToolbar: Function;
41
 
46
 
42
     /**
47
     /**
43
      * Initializes a new Conference instance.
48
      * Initializes a new Conference instance.
117
                 <DialogContainer />
122
                 <DialogContainer />
118
                 <NotificationsContainer />
123
                 <NotificationsContainer />
119
 
124
 
125
+                { this.props._calleeInfoVisible
126
+                    && <CalleeInfo />
127
+                }
128
+
120
                 {/*
129
                 {/*
121
                   * Temasys automatically injects a notification bar, if
130
                   * Temasys automatically injects a notification bar, if
122
                   * necessary, displayed at the top of the page notifying that
131
                   * necessary, displayed at the top of the page notifying that
152
  */
161
  */
153
 function _mapStateToProps(state) {
162
 function _mapStateToProps(state) {
154
     return {
163
     return {
164
+        ...abstractMapStateToProps(state),
165
+
166
+        /**
167
+         * Indicates if the current user is recording the conference, ie, they
168
+         * are a recorder.
169
+         *
170
+         * @private
171
+         */
155
         _isRecording: state['features/base/config'].iAmRecorder
172
         _isRecording: state['features/base/config'].iAmRecorder
156
     };
173
     };
157
 }
174
 }

+ 25
- 0
react/features/conference/functions.js Просмотреть файл

1
+// @flow
2
+
3
+/**
4
+ * Maps parts of the redux state to {@link Toolbox} (React {@code Component})
5
+ * props.
6
+ *
7
+ * @param {Object} state - The redux state of which parts are to be mapped to
8
+ * {@code Conference} props.
9
+ * @protected
10
+ * @returns {{
11
+ *     _calleeInfoVisible: boolean
12
+ * }}
13
+ */
14
+export function abstractMapStateToProps(state: Object): Object {
15
+    return {
16
+        /**
17
+         * The indication which determines if the {@code CalleeInfo} component
18
+         * should be shown or not.
19
+         *
20
+         * @private
21
+         * @type {boolean}
22
+         */
23
+        _calleeInfoVisible: state['features/base/jwt'].calleeInfoVisible
24
+    };
25
+}

+ 4
- 4
react/features/filmstrip/middleware.js Просмотреть файл

1
 /* @flow */
1
 /* @flow */
2
 
2
 
3
 import { MiddlewareRegistry } from '../base/redux';
3
 import { MiddlewareRegistry } from '../base/redux';
4
-import { SET_CALL_OVERLAY_VISIBLE } from '../base/jwt';
4
+import { SET_CALLEE_INFO_VISIBLE } from '../base/jwt';
5
 
5
 
6
 import Filmstrip from '../../../modules/UI/videolayout/Filmstrip';
6
 import Filmstrip from '../../../modules/UI/videolayout/Filmstrip';
7
 
7
 
10
 // eslint-disable-next-line no-unused-vars
10
 // eslint-disable-next-line no-unused-vars
11
 MiddlewareRegistry.register(({ getState }) => next => action => {
11
 MiddlewareRegistry.register(({ getState }) => next => action => {
12
     switch (action.type) {
12
     switch (action.type) {
13
-    case SET_CALL_OVERLAY_VISIBLE:
13
+    case SET_CALLEE_INFO_VISIBLE:
14
         if (typeof APP !== 'undefined') {
14
         if (typeof APP !== 'undefined') {
15
             const oldValue
15
             const oldValue
16
-                = Boolean(getState()['features/base/jwt'].callOverlayVisible);
16
+                = Boolean(getState()['features/base/jwt'].calleeInfoVisible);
17
             const result = next(action);
17
             const result = next(action);
18
             const newValue
18
             const newValue
19
-                = Boolean(getState()['features/base/jwt'].callOverlayVisible);
19
+                = Boolean(getState()['features/base/jwt'].calleeInfoVisible);
20
 
20
 
21
             oldValue === newValue
21
             oldValue === newValue
22
 
22
 

+ 1
- 1
react/features/notifications/components/NotificationsContainer.web.js Просмотреть файл

185
     const isAnyOverlayVisible = (connectionEstablished && haveToReload)
185
     const isAnyOverlayVisible = (connectionEstablished && haveToReload)
186
         || isMediaPermissionPromptVisible
186
         || isMediaPermissionPromptVisible
187
         || suspendDetected
187
         || suspendDetected
188
-        || state['features/base/jwt'].callOverlayVisible;
188
+        || state['features/base/jwt'].calleeInfoVisible;
189
 
189
 
190
     const { enabled, notifications } = state['features/notifications'];
190
     const { enabled, notifications } = state['features/notifications'];
191
 
191
 

+ 1
- 4
react/features/overlay/components/OverlayContainer.js Просмотреть файл

3
 import React, { Component } from 'react';
3
 import React, { Component } from 'react';
4
 import { connect } from 'react-redux';
4
 import { connect } from 'react-redux';
5
 
5
 
6
-import { CallOverlay } from '../../base/jwt';
7
-
8
 import PageReloadFilmstripOnlyOverlay from './PageReloadFilmstripOnlyOverlay';
6
 import PageReloadFilmstripOnlyOverlay from './PageReloadFilmstripOnlyOverlay';
9
 import PageReloadOverlay from './PageReloadOverlay';
7
 import PageReloadOverlay from './PageReloadOverlay';
10
 import SuspendedFilmstripOnlyOverlay from './SuspendedFilmstripOnlyOverlay';
8
 import SuspendedFilmstripOnlyOverlay from './SuspendedFilmstripOnlyOverlay';
95
         overlays = _nonFilmstripOnlyOverlays = [
93
         overlays = _nonFilmstripOnlyOverlays = [
96
             PageReloadOverlay,
94
             PageReloadOverlay,
97
             SuspendedOverlay,
95
             SuspendedOverlay,
98
-            UserMediaPermissionsOverlay,
99
-            CallOverlay
96
+            UserMediaPermissionsOverlay
100
         ];
97
         ];
101
     }
98
     }
102
 
99
 

+ 1
- 1
react/features/toolbox/actions.web.js Просмотреть файл

187
 
187
 
188
         if (!force
188
         if (!force
189
                 && (hovered
189
                 && (hovered
190
-                    || state['features/base/jwt'].callOverlayVisible
190
+                    || state['features/base/jwt'].calleeInfoVisible
191
                     || SideContainerToggler.isVisible())) {
191
                     || SideContainerToggler.isVisible())) {
192
             dispatch(
192
             dispatch(
193
                 setToolboxTimeout(
193
                 setToolboxTimeout(

Загрузка…
Отмена
Сохранить