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).
This commit is contained in:
Guus der Kinderen 2017-04-26 14:50:24 +02:00 committed by Lyubo Marinov
parent 7836fd1990
commit 00b4176bf8
1 changed files with 36 additions and 18 deletions

View File

@ -96,19 +96,29 @@ class Watermarks extends Component {
* @returns {ReactElement|null} Watermark element or null. * @returns {ReactElement|null} Watermark element or null.
*/ */
_renderBrandWatermark() { _renderBrandWatermark() {
let reactElement = null;
if (this.state.showBrandWatermark) { if (this.state.showBrandWatermark) {
return ( reactElement = ( // eslint-disable-line no-extra-parens
<a <div
href = { this.state.brandWatermarkLink } className = 'watermark rightwatermark'
target = '_new'> style = { _RIGHT_WATERMARK_STYLE } />
<div
className = 'watermark rightwatermark'
style = { _RIGHT_WATERMARK_STYLE } />
</a>
); );
const { brandWatermarkLink } = this.state;
if (brandWatermarkLink) {
reactElement = ( // eslint-disable-line no-extra-parens
<a
href = { brandWatermarkLink }
target = '_new'>
{ reactElement }
</a>
);
}
} }
return null; return reactElement;
} }
/** /**
@ -118,19 +128,27 @@ class Watermarks extends Component {
* @returns {ReactElement|null} * @returns {ReactElement|null}
*/ */
_renderJitsiWatermark() { _renderJitsiWatermark() {
let reactElement = null;
if (this.state.showJitsiWatermark if (this.state.showJitsiWatermark
|| (APP.tokenData.isGuest || (APP.tokenData.isGuest
&& this.state.showJitsiWatermarkForGuests)) { && this.state.showJitsiWatermarkForGuests)) {
return ( reactElement = <div className = 'watermark leftwatermark' />;
<a
href = { this.state.jitsiWatermarkLink } const { jitsiWatermarkLink } = this.state;
target = '_new'>
<div className = 'watermark leftwatermark' /> if (jitsiWatermarkLink) {
</a> reactElement = ( // eslint-disable-line no-extra-parens
); <a
href = { jitsiWatermarkLink }
target = '_new'>
{ reactElement }
</a>
);
}
} }
return null; return reactElement;
} }
/** /**