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() {
|
2017-03-01 02:55:12 +00:00
|
|
|
const { browser, t } = this.props;
|
2017-01-31 20:58:48 +00:00
|
|
|
|
|
|
|
return (
|
2017-03-06 22:03:50 +00:00
|
|
|
<OverlayFrame>
|
2017-01-31 20:58:48 +00:00
|
|
|
<div className = 'inlay'>
|
|
|
|
<span className = 'inlay__icon icon-microphone' />
|
|
|
|
<span className = 'inlay__icon icon-camera' />
|
2017-02-23 16:56:25 +00:00
|
|
|
<h3 className = 'inlay__title'>
|
2017-03-01 02:55:12 +00:00
|
|
|
{
|
2017-03-09 00:16:53 +00:00
|
|
|
t('startupoverlay.title',
|
2017-03-01 02:55:12 +00:00
|
|
|
{ postProcess: 'resolveAppName' })
|
|
|
|
}
|
2017-02-23 16:56:25 +00:00
|
|
|
</h3>
|
|
|
|
<span className = 'inlay__text'>
|
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'>
|
2017-02-23 16:56:25 +00:00
|
|
|
<p className = 'policy__text'>
|
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'>
|
2017-02-19 00:42:11 +00:00
|
|
|
<img src = { policyLogoSrc } />
|
2017-01-31 20:58:48 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
2017-02-23 16:56:25 +00:00
|
|
|
|
2017-11-09 13:34:42 +00:00
|
|
|
export default translate(
|
|
|
|
connect(abstractMapStateToProps)(UserMediaPermissionsOverlay));
|