Merge pull request #1217 from BeatC/fix-watermarks

Fixes issue with watermarks and interface configs.
This commit is contained in:
Дамян Минков 2016-12-30 16:34:39 -06:00 committed by GitHub
commit c46772015b
1 changed files with 95 additions and 12 deletions

View File

@ -1,3 +1,4 @@
/* global interfaceConfig */
import React, { Component } from 'react'; import React, { Component } from 'react';
/** /**
@ -13,6 +14,30 @@ const DISPLAY_NONE_STYLE = {
*/ */
export default class Conference extends Component { 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()}. * Implements React's {@link Component#render()}.
* *
@ -55,18 +80,15 @@ export default class Conference extends Component {
<div id = 'sharedVideoIFrame' /> <div id = 'sharedVideoIFrame' />
</div> </div>
<div id = 'etherpad' /> <div id = 'etherpad' />
<a target = '_new'> {
<div className = 'watermark leftwatermark' /> this._renderJitsiWatermark()
</a> }
<a target = '_new'> {
<div className = 'watermark rightwatermark' /> this._renderBrandWatermark()
</a> }
<a {
className = 'poweredby hide' this._renderPoweredBy()
href = 'http://jitsi.org' }
target = '_new'>
<span data-i18n = 'poweredby' /> jitsi.org
</a>
<div id = 'dominantSpeaker'> <div id = 'dominantSpeaker'>
<div className = 'dynamic-shadow' /> <div className = 'dynamic-shadow' />
<img <img
@ -130,4 +152,65 @@ export default class Conference extends Component {
</div> </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;
}
} }