Skip to content

Commit

Permalink
Merge pull request #1217 from BeatC/fix-watermarks
Browse files Browse the repository at this point in the history
Fixes issue with watermarks and interface configs.
  • Loading branch information
damencho authored Dec 30, 2016
2 parents cd03b29 + 677eef1 commit c467720
Showing 1 changed file with 95 additions and 12 deletions.
107 changes: 95 additions & 12 deletions react/features/conference/components/Conference.web.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* global interfaceConfig */
import React, { Component } from 'react';

/**
Expand All @@ -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()}.
*
Expand Down Expand Up @@ -55,18 +80,15 @@ export default class Conference extends Component {
<div id = 'sharedVideoIFrame' />
</div>
<div id = 'etherpad' />
<a target = '_new'>
<div className = 'watermark leftwatermark' />
</a>
<a target = '_new'>
<div className = 'watermark rightwatermark' />
</a>
<a
className = 'poweredby hide'
href = 'http://jitsi.org'
target = '_new'>
<span data-i18n = 'poweredby' /> jitsi.org
</a>
{
this._renderJitsiWatermark()
}
{
this._renderBrandWatermark()
}
{
this._renderPoweredBy()
}
<div id = 'dominantSpeaker'>
<div className = 'dynamic-shadow' />
<img
Expand Down Expand Up @@ -130,4 +152,65 @@ export default class Conference extends Component {
</div>
);
}

/**
* Method that returns brand watermark element if it is enabled.
*
* @returns {ReactElement|null}
* @private
*/
_renderBrandWatermark() {
if (this.state.showBrandWatermark) {
return (
<a
href = { this.state.brandWatermarkLink }
target = '_new'>
<div className = 'watermark rightwatermark' />
</a>
);
}

return null;
}

/**
* Method that returns jitsi watermark element if it is enabled.
*
* @returns {ReactElement|null}
* @private
*/
_renderJitsiWatermark() {
if (this.state.showJitsiWatermark) {
return (
<a
href = { this.state.jitsiWatermarkLink }
target = '_new'>
<div className = 'watermark leftwatermark' />
</a>
);
}

return null;
}

/**
* Renders powered by block if it is enabled.
*
* @returns {ReactElement|null}
* @private
*/
_renderPoweredBy() {
if (this.state.showPoweredBy) {
return (
<a
className = 'poweredby hide'
href = 'http://jitsi.org'
target = '_new'>
<span data-i18n = 'poweredby' /> jitsi.org
</a>
);
}

return null;
}
}

0 comments on commit c467720

Please sign in to comment.