Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

Toolbar notice as React Component

Ilya Daynatovich59a74153dc9e
diff --git a/css/_notice.scss b/css/_notice.scss
index 6c8e0fc1ba..9d915434bb 100644
--- a/css/_notice.scss
+++ b/css/_notice.scss
@@ -1,11 +1,12 @@
-#notice {
+.notice {
position: relative;
z-index: 3;
margin-top: 6px;
+
+ &__message {
+ background-color: #000000;
+ color: white;
+ padding: 3px;
+ border-radius: 5px;
+ }
}
-#noticeText {
- background-color: #000000;
- color: white;
- padding: 3px;
- border-radius: 5px;
-}
\ No newline at end of file
diff --git a/modules/UI/UI.js b/modules/UI/UI.js
index e58d46593c..1ba3b06d07 100644
--- a/modules/UI/UI.js
+++ b/modules/UI/UI.js
@@ -315,12 +315,6 @@ UI.start = function () {
// Initialise the recording module.
if (config.enableRecording)
Recording.init(eventEmitter, config.recordingType);
-
- // Display notice message at the top of the toolbar
- if (config.noticeMessage) {
- $('#noticeText').text(config.noticeMessage);
- UIUtil.setVisible('notice', true);
- }
} else {
$("body").addClass("filmstrip-only");
UIUtil.setVisible('mainToolbarContainer', false);
diff --git a/react/features/conference/components/Conference.web.js b/react/features/conference/components/Conference.web.js
index 82f7c28151..90bd2b8efa 100644
--- a/react/features/conference/components/Conference.web.js
+++ b/react/features/conference/components/Conference.web.js
@@ -8,23 +8,12 @@ import { DialogContainer } from '../../base/dialog';
import { Watermarks } from '../../base/react';
import { FeedbackButton } from '../../feedback';
import { OverlayContainer } from '../../overlay';
+import { Notice } from '../../toolbar';
import { HideNotificationBarStyle } from '../../unsupported-browser';
declare var $: Function;
declare var APP: Object;
-/**
- * For legacy reasons, inline style for display none.
- *
- * @private
- * @type {{
- * display: string
- * }}
- */
-const _DISPLAY_NONE_STYLE = {
- display: 'none'
-};
-
/**
* The conference page of the Web application.
*/
@@ -78,14 +67,8 @@ class Conference extends Component {
return (
<div id = 'videoconference_page'>
<div id = 'mainToolbarContainer'>
- <div
- className = 'notice'
- id = 'notice'
- style = { _DISPLAY_NONE_STYLE }>
- <span
- className = 'noticeText'
- id = 'noticeText' />
- </div>
+ <Notice />
+
<div
className = 'toolbar'
id = 'mainToolbar' />
diff --git a/react/features/toolbar/components/Notice.js b/react/features/toolbar/components/Notice.js
new file mode 100644
index 0000000000..4587cf3174
--- /dev/null
+++ b/react/features/toolbar/components/Notice.js
@@ -0,0 +1,52 @@
+/* @flow */
+
+import React, { Component } from 'react';
+
+declare var config: Object;
+
+/**
+ * Notice react component.
+ *
+ * @class Notice
+ */
+export default class Notice extends Component {
+ state: Object;
+
+ /**
+ * Constructor of Notice component.
+ *
+ * @param {Object} props - The read-only React Component props with which
+ * the new instance is to be initialized.
+ */
+ constructor(props: Object) {
+ super(props);
+
+ const { noticeMessage } = config;
+
+ this.state = {
+ noticeMessage
+ };
+ }
+
+ /**
+ * Implements React's {@link Component#render()}.
+ *
+ * @inheritdoc
+ * @returns {ReactElement}
+ */
+ render() {
+ const { noticeMessage } = this.state;
+
+ if (!noticeMessage) {
+ return null;
+ }
+
+ return (
+ <div className = 'notice'>
+ <span className = 'notice__message' >
+ { noticeMessage }
+ </span>
+ </div>
+ );
+ }
+}
diff --git a/react/features/toolbar/components/Toolbar.web.js b/react/features/toolbar/components/Toolbar.web.js
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/react/features/toolbar/components/index.js b/react/features/toolbar/components/index.js
index dae206ceef..4acd038102 100644
--- a/react/features/toolbar/components/index.js
+++ b/react/features/toolbar/components/index.js
@@ -1 +1,2 @@
+export { default as Notice } from './Notice';
export { default as Toolbar } from './Toolbar';