Browse Source

noticeMessage is not shown (refs #3295)

* Get back the Notice class
* Add Notice component in the Conference web view
* Notice is not exported in index.js. Only used internally by
  Conference.
* noticeMessage value obtained from features/base/config
  * using mapStateToProps
  * value is stored in the internal _message property
* Notice component, orignal in `toolbox` is moved from
  `toolbox/components` to `conference/components`
* Notice component only implemented and renderable in web views
* Dummy `conference/components/Notice.naive.js`

This patch is partially based in the removed logic included
originally in:

    commit 59a74153dc
    (tag: jitsi-meet_1886, tag: jitsi-meet_1885, tag: 1797, tag: 1796)
    Author: Ilya Daynatovich <shupuercha@gmail.com>
    Date:   Mon Mar 20 11:04:54 2017 -0500

      Toolbar notice as React Component

In reply to: Saúl Ibarra Corretgé @saghul> comments

Signed-off-by: Pablo Saavedra <psaavedra@igalia.com>
master
Pablo Saavedra 7 years ago
parent
commit
fd78203ff8

+ 2
- 0
react/features/conference/components/Conference.web.js View File

@@ -13,6 +13,7 @@ import { CalleeInfoContainer } from '../../invite';
13 13
 import { LargeVideo } from '../../large-video';
14 14
 import { NotificationsContainer } from '../../notifications';
15 15
 import { SidePanel } from '../../side-panel';
16
+import { default as Notice } from './Notice';
16 17
 import {
17 18
     Toolbox,
18 19
     fullScreenChanged,
@@ -163,6 +164,7 @@ class Conference extends Component<Props> {
163 164
             <div
164 165
                 id = 'videoconference_page'
165 166
                 onMouseMove = { this._onShowToolbar }>
167
+                <Notice />
166 168
                 <div id = 'videospace'>
167 169
                     <LargeVideo
168 170
                         hideVideoQualityLabel = { hideVideoQualityLabel } />

+ 0
- 0
react/features/conference/components/Notice.naive.js View File


+ 61
- 0
react/features/conference/components/Notice.web.js View File

@@ -0,0 +1,61 @@
1
+/* @flow */
2
+
3
+import React, { Component } from 'react';
4
+import { connect } from 'react-redux';
5
+
6
+import { translate } from '../../base/i18n';
7
+
8
+declare var config: Object;
9
+
10
+type Props = {
11
+    _message?: string,
12
+};
13
+
14
+/**
15
+ * Notice react component.
16
+ *
17
+ * @class Notice
18
+ */
19
+class Notice extends Component<Props> {
20
+
21
+    /**
22
+     * Implements React's {@link Component#render()}.
23
+     *
24
+     * @inheritdoc
25
+     * @returns {ReactElement}
26
+     */
27
+    render() {
28
+        if (!this.props._message) {
29
+            return null;
30
+        }
31
+
32
+        return (
33
+            <div className = 'notice'>
34
+                <span className = 'notice__message' >
35
+                    { this.props._message }
36
+                </span>
37
+            </div>
38
+        );
39
+    }
40
+}
41
+
42
+/**
43
+ * Maps (parts of) the Redux state to the associated
44
+ * {@code Notice}'s props.
45
+ *
46
+ * @param {Object} state - The Redux state.
47
+ * @private
48
+ * @returns {{
49
+ *     _message: string,
50
+ * }}
51
+ */
52
+function _mapStateToProps(state) {
53
+    const {
54
+        noticeMessage
55
+    } = state['features/base/config'];
56
+
57
+    return {
58
+        _message: noticeMessage
59
+    };
60
+}
61
+export default translate(connect(_mapStateToProps)(Notice));

+ 2
- 0
react/features/conference/components/index.js View File

@@ -1 +1,3 @@
1
+// @flow
2
+
1 3
 export { default as Conference } from './Conference';

Loading…
Cancel
Save