From 5bb53ba036c7e8eb0311f09e56040d131db299be Mon Sep 17 00:00:00 2001 From: Ilya Daynatovich Date: Fri, 30 Dec 2016 13:34:03 +0200 Subject: [PATCH 1/2] Fix issue with watermarks --- .../conference/components/Conference.web.js | 107 ++++++++++++++++-- 1 file changed, 95 insertions(+), 12 deletions(-) diff --git a/react/features/conference/components/Conference.web.js b/react/features/conference/components/Conference.web.js index 2b9257b5d..c1f522e11 100644 --- a/react/features/conference/components/Conference.web.js +++ b/react/features/conference/components/Conference.web.js @@ -1,3 +1,4 @@ +/* global interfaceConfig */ import React, { Component } from 'react'; /** @@ -13,6 +14,30 @@ const DISPLAY_NONE_STYLE = { */ export default class Conference extends Component { + /** + * Initializes Conference component instance. + * + * @param {Object} props - The read-only properties with which the new + * instance is to be initialized. + */ + constructor(props) { + super(props); + + const showBrandWatermark = interfaceConfig.SHOW_BRAND_WATERMARK; + const showJitsiWatermark = interfaceConfig.SHOW_JITSI_WATERMARK; + + this.state = { + ...this.state, + showBrandWatermark, + showJitsiWatermark, + brandWatermarkLink: + showBrandWatermark ? interfaceConfig.BRAND_WATERMARK_LINK : '', + jitsiWatermarkLink: + showJitsiWatermark ? interfaceConfig.JITSI_WATERMARK_LINK : '', + showPoweredBy: interfaceConfig.SHOW_POWERED_BY + }; + } + /** * Implements React's {@link Component#render()}. * @@ -55,18 +80,15 @@ export default class Conference extends Component {
- -
- - -
- - - jitsi.org - + { + this._renderJitsiWatermark() + } + { + this._renderBrandWatermark() + } + { + this._renderPoweredBy() + }
); } + + /** + * Method that returns brand watermark element if it is enabled. + * + * @returns {ReactElement|null} + * @private + */ + _renderBrandWatermark() { + if (this.state.showBrandWatermark) { + return ( + +
+ + ); + } + + return null; + } + + /** + * Method that returns jitsi watermark element if it is enabled. + * + * @returns {ReactElement|null} + * @private + */ + _renderJitsiWatermark() { + if (this.state.jitsiWatermarkLink) { + return ( + +
+ + ); + } + + return null; + } + + /** + * Renders powered by block if it is enabled. + * + * @returns {ReactElement|null} + * @private + */ + _renderPoweredBy() { + if (this.state.showPoweredBy) { + return ( + + jitsi.org + + ); + } + + return null; + } } From 677eef12ddd80498b9e6fa9d81c0c37e305998a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D1=8F=D0=BD=20=D0=9C=D0=B8=D0=BD=D0=BA?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Fri, 30 Dec 2016 12:07:54 -0600 Subject: [PATCH 2/2] Updates use of showJitsiWatermark. --- react/features/conference/components/Conference.web.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react/features/conference/components/Conference.web.js b/react/features/conference/components/Conference.web.js index c1f522e11..cda4e0179 100644 --- a/react/features/conference/components/Conference.web.js +++ b/react/features/conference/components/Conference.web.js @@ -180,7 +180,7 @@ export default class Conference extends Component { * @private */ _renderJitsiWatermark() { - if (this.state.jitsiWatermarkLink) { + if (this.state.showJitsiWatermark) { return (