2019-04-09 11:05:20 +00:00
|
|
|
// @flow
|
2017-01-31 20:58:48 +00:00
|
|
|
|
2017-11-09 13:34:42 +00:00
|
|
|
import React from 'react';
|
2017-01-31 20:58:48 +00:00
|
|
|
|
2019-04-09 11:05:20 +00:00
|
|
|
import { translate, translateToHTML } from '../../../base/i18n';
|
|
|
|
import { connect } from '../../../base/redux';
|
2017-01-31 20:58:48 +00:00
|
|
|
|
2017-11-09 13:34:42 +00:00
|
|
|
import AbstractUserMediaPermissionsOverlay, { abstractMapStateToProps }
|
|
|
|
from './AbstractUserMediaPermissionsOverlay';
|
2017-03-06 22:03:50 +00:00
|
|
|
import OverlayFrame from './OverlayFrame';
|
2017-02-23 16:56:25 +00:00
|
|
|
|
2019-04-09 11:05:20 +00:00
|
|
|
declare var interfaceConfig: Object;
|
|
|
|
|
2017-01-31 20:58:48 +00:00
|
|
|
/**
|
|
|
|
* Implements a React Component for overlay with guidance how to proceed with
|
|
|
|
* gUM prompt.
|
|
|
|
*/
|
2017-11-09 13:34:42 +00:00
|
|
|
class UserMediaPermissionsOverlay extends AbstractUserMediaPermissionsOverlay {
|
2017-01-31 20:58:48 +00:00
|
|
|
/**
|
2017-03-06 22:03:50 +00:00
|
|
|
* Implements React's {@link Component#render()}.
|
2017-01-31 20:58:48 +00:00
|
|
|
*
|
2017-03-06 22:03:50 +00:00
|
|
|
* @inheritdoc
|
2017-11-27 22:08:12 +00:00
|
|
|
* @returns {ReactElement}
|
2017-01-31 20:58:48 +00:00
|
|
|
*/
|
2017-03-06 22:03:50 +00:00
|
|
|
render() {
|
2022-03-10 13:31:27 +00:00
|
|
|
const { _premeetingBackground, browser, t } = this.props;
|
|
|
|
const style = _premeetingBackground ? {
|
|
|
|
background: _premeetingBackground,
|
|
|
|
backgroundPosition: 'center',
|
|
|
|
backgroundSize: 'cover'
|
|
|
|
} : {};
|
2017-01-31 20:58:48 +00:00
|
|
|
|
|
|
|
return (
|
2022-03-10 13:31:27 +00:00
|
|
|
<OverlayFrame style = { style }>
|
2017-01-31 20:58:48 +00:00
|
|
|
<div className = 'inlay'>
|
|
|
|
<span className = 'inlay__icon icon-microphone' />
|
|
|
|
<span className = 'inlay__icon icon-camera' />
|
2021-06-10 12:48:44 +00:00
|
|
|
<h3
|
|
|
|
aria-label = { t('startupoverlay.genericTitle') }
|
|
|
|
className = 'inlay__title'
|
|
|
|
role = 'alert' >
|
2017-03-01 02:55:12 +00:00
|
|
|
{
|
2020-11-11 10:54:09 +00:00
|
|
|
t('startupoverlay.genericTitle')
|
2017-03-01 02:55:12 +00:00
|
|
|
}
|
2017-02-23 16:56:25 +00:00
|
|
|
</h3>
|
2021-06-10 12:48:44 +00:00
|
|
|
<span
|
|
|
|
className = 'inlay__text'
|
|
|
|
role = 'alert' >
|
2017-03-01 02:55:12 +00:00
|
|
|
{
|
2017-03-09 00:16:53 +00:00
|
|
|
translateToHTML(t,
|
2017-03-01 02:55:12 +00:00
|
|
|
`userMedia.${browser}GrantPermissions`)
|
|
|
|
}
|
2017-02-23 16:56:25 +00:00
|
|
|
</span>
|
2017-01-31 20:58:48 +00:00
|
|
|
</div>
|
|
|
|
<div className = 'policy overlay__policy'>
|
2021-06-10 12:48:44 +00:00
|
|
|
<p
|
|
|
|
className = 'policy__text'
|
|
|
|
role = 'alert'>
|
2017-03-06 22:03:50 +00:00
|
|
|
{ translateToHTML(t, 'startupoverlay.policyText') }
|
2017-02-23 16:56:25 +00:00
|
|
|
</p>
|
2017-02-19 00:42:11 +00:00
|
|
|
{
|
|
|
|
this._renderPolicyLogo()
|
|
|
|
}
|
2017-01-31 20:58:48 +00:00
|
|
|
</div>
|
2017-03-06 22:03:50 +00:00
|
|
|
</OverlayFrame>
|
2017-01-31 20:58:48 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Renders the policy logo.
|
|
|
|
*
|
|
|
|
* @private
|
2017-11-27 22:08:12 +00:00
|
|
|
* @returns {ReactElement|null}
|
2017-01-31 20:58:48 +00:00
|
|
|
*/
|
|
|
|
_renderPolicyLogo() {
|
2019-04-09 11:05:20 +00:00
|
|
|
const policyLogoSrc = interfaceConfig.POLICY_LOGO;
|
2017-02-19 00:42:11 +00:00
|
|
|
|
|
|
|
if (policyLogoSrc) {
|
2017-01-31 20:58:48 +00:00
|
|
|
return (
|
|
|
|
<div className = 'policy__logo'>
|
2021-06-10 12:48:44 +00:00
|
|
|
<img
|
|
|
|
alt = { this.props.t('welcomepage.logo.policyLogo') }
|
|
|
|
src = { policyLogoSrc } />
|
2017-01-31 20:58:48 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
2017-02-23 16:56:25 +00:00
|
|
|
|
2022-03-10 13:31:27 +00:00
|
|
|
/**
|
|
|
|
* Maps (parts of) the redux state to the React {@code Component} props.
|
|
|
|
*
|
|
|
|
* @param {Object} state - The redux state.
|
|
|
|
* @param {Object} ownProps - The props passed to the component.
|
|
|
|
* @returns {Object}
|
|
|
|
*/
|
|
|
|
function mapStateToProps(state): Object {
|
|
|
|
const { premeetingBackground } = state['features/dynamic-branding'];
|
|
|
|
|
|
|
|
return {
|
2022-03-24 11:08:35 +00:00
|
|
|
...abstractMapStateToProps(state),
|
2022-03-10 13:31:27 +00:00
|
|
|
_premeetingBackground: premeetingBackground
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2017-11-09 13:34:42 +00:00
|
|
|
export default translate(
|
2022-03-10 13:31:27 +00:00
|
|
|
connect(mapStateToProps)(UserMediaPermissionsOverlay));
|