From 00b4176bf8ce74acea56bb5749dc81716afd6dfe Mon Sep 17 00:00:00 2001 From: Guus der Kinderen Date: Wed, 26 Apr 2017 14:50:24 +0200 Subject: [PATCH] Non-clickable watermarks without links Watermarks can be used to link to an external site by configuring a URL. However, the URL is optional. When it is not set, the watermark should not be clickable. This prevents users from reloading the room by clicking on a watermark (caused by an HTML anchor element without an href). --- .../base/react/components/Watermarks.web.js | 54 ++++++++++++------- 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/react/features/base/react/components/Watermarks.web.js b/react/features/base/react/components/Watermarks.web.js index 18d7d3b8e..ed1b49bde 100644 --- a/react/features/base/react/components/Watermarks.web.js +++ b/react/features/base/react/components/Watermarks.web.js @@ -96,19 +96,29 @@ class Watermarks extends Component { * @returns {ReactElement|null} Watermark element or null. */ _renderBrandWatermark() { + let reactElement = null; + if (this.state.showBrandWatermark) { - return ( - -
- + reactElement = ( // eslint-disable-line no-extra-parens +
); + + const { brandWatermarkLink } = this.state; + + if (brandWatermarkLink) { + reactElement = ( // eslint-disable-line no-extra-parens + + { reactElement } + + ); + } } - return null; + return reactElement; } /** @@ -118,19 +128,27 @@ class Watermarks extends Component { * @returns {ReactElement|null} */ _renderJitsiWatermark() { + let reactElement = null; + if (this.state.showJitsiWatermark - || (APP.tokenData.isGuest + || (APP.tokenData.isGuest && this.state.showJitsiWatermarkForGuests)) { - return ( - -
- - ); + reactElement =
; + + const { jitsiWatermarkLink } = this.state; + + if (jitsiWatermarkLink) { + reactElement = ( // eslint-disable-line no-extra-parens + + { reactElement } + + ); + } } - return null; + return reactElement; } /**