Files
jitsi-meet/react/features/conference/components/Notice.web.js
Pablo Saavedra fd78203ff8 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>
2018-07-25 14:16:47 -05:00

62 lines
1.1 KiB
JavaScript

/* @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<Props> {
/**
* Implements React's {@link Component#render()}.
*
* @inheritdoc
* @returns {ReactElement}
*/
render() {
if (!this.props._message) {
return null;
}
return (
<div className = 'notice'>
<span className = 'notice__message' >
{ this.props._message }
</span>
</div>
);
}
}
/**
* 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));