From fd78203ff8d7e8dfa4e2f34969401d29b524a940 Mon Sep 17 00:00:00 2001 From: Pablo Saavedra Date: Tue, 24 Jul 2018 15:08:26 +0200 Subject: [PATCH] noticeMessage is not shown (refs #3295) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 59a74153dc9ec0432cbc6f1fac5ef9c1b3566cd4 (tag: jitsi-meet_1886, tag: jitsi-meet_1885, tag: 1797, tag: 1796) Author: Ilya Daynatovich 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 --- .../conference/components/Conference.web.js | 2 + .../conference/components/Notice.naive.js | 0 .../conference/components/Notice.web.js | 61 +++++++++++++++++++ react/features/conference/components/index.js | 2 + 4 files changed, 65 insertions(+) create mode 100644 react/features/conference/components/Notice.naive.js create mode 100644 react/features/conference/components/Notice.web.js diff --git a/react/features/conference/components/Conference.web.js b/react/features/conference/components/Conference.web.js index 4a3d17dfe..5a3cc838e 100644 --- a/react/features/conference/components/Conference.web.js +++ b/react/features/conference/components/Conference.web.js @@ -13,6 +13,7 @@ import { CalleeInfoContainer } from '../../invite'; import { LargeVideo } from '../../large-video'; import { NotificationsContainer } from '../../notifications'; import { SidePanel } from '../../side-panel'; +import { default as Notice } from './Notice'; import { Toolbox, fullScreenChanged, @@ -163,6 +164,7 @@ class Conference extends Component {
+
diff --git a/react/features/conference/components/Notice.naive.js b/react/features/conference/components/Notice.naive.js new file mode 100644 index 000000000..e69de29bb diff --git a/react/features/conference/components/Notice.web.js b/react/features/conference/components/Notice.web.js new file mode 100644 index 000000000..acaee877b --- /dev/null +++ b/react/features/conference/components/Notice.web.js @@ -0,0 +1,61 @@ +/* @flow */ + +import React, { Component } from 'react'; +import { connect } from 'react-redux'; + +import { translate } from '../../base/i18n'; + +declare var config: Object; + +type Props = { + _message?: string, +}; + +/** + * Notice react component. + * + * @class Notice + */ +class Notice extends Component { + + /** + * Implements React's {@link Component#render()}. + * + * @inheritdoc + * @returns {ReactElement} + */ + render() { + if (!this.props._message) { + return null; + } + + return ( +
+ + { this.props._message } + +
+ ); + } +} + +/** + * Maps (parts of) the Redux state to the associated + * {@code Notice}'s props. + * + * @param {Object} state - The Redux state. + * @private + * @returns {{ + * _message: string, + * }} + */ +function _mapStateToProps(state) { + const { + noticeMessage + } = state['features/base/config']; + + return { + _message: noticeMessage + }; +} +export default translate(connect(_mapStateToProps)(Notice)); diff --git a/react/features/conference/components/index.js b/react/features/conference/components/index.js index 7ee56f548..0910dcaff 100644 --- a/react/features/conference/components/index.js +++ b/react/features/conference/components/index.js @@ -1 +1,3 @@ +// @flow + export { default as Conference } from './Conference';