You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

UserMediaPermissionsOverlay.js 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // @flow
  2. import React from 'react';
  3. import { translate, translateToHTML } from '../../../base/i18n';
  4. import { connect } from '../../../base/redux';
  5. import AbstractUserMediaPermissionsOverlay, { abstractMapStateToProps }
  6. from './AbstractUserMediaPermissionsOverlay';
  7. import OverlayFrame from './OverlayFrame';
  8. declare var interfaceConfig: Object;
  9. /**
  10. * Implements a React Component for overlay with guidance how to proceed with
  11. * gUM prompt.
  12. */
  13. class UserMediaPermissionsOverlay extends AbstractUserMediaPermissionsOverlay {
  14. /**
  15. * Implements React's {@link Component#render()}.
  16. *
  17. * @inheritdoc
  18. * @returns {ReactElement}
  19. */
  20. render() {
  21. const { browser, t } = this.props;
  22. return (
  23. <OverlayFrame>
  24. <div className = 'inlay'>
  25. <span className = 'inlay__icon icon-microphone' />
  26. <span className = 'inlay__icon icon-camera' />
  27. <h3 className = 'inlay__title'>
  28. {
  29. t('startupoverlay.genericTitle')
  30. }
  31. </h3>
  32. <span className = 'inlay__text'>
  33. {
  34. translateToHTML(t,
  35. `userMedia.${browser}GrantPermissions`)
  36. }
  37. </span>
  38. </div>
  39. <div className = 'policy overlay__policy'>
  40. <p className = 'policy__text'>
  41. { translateToHTML(t, 'startupoverlay.policyText') }
  42. </p>
  43. {
  44. this._renderPolicyLogo()
  45. }
  46. </div>
  47. </OverlayFrame>
  48. );
  49. }
  50. /**
  51. * Renders the policy logo.
  52. *
  53. * @private
  54. * @returns {ReactElement|null}
  55. */
  56. _renderPolicyLogo() {
  57. const policyLogoSrc = interfaceConfig.POLICY_LOGO;
  58. if (policyLogoSrc) {
  59. return (
  60. <div className = 'policy__logo'>
  61. <img src = { policyLogoSrc } />
  62. </div>
  63. );
  64. }
  65. return null;
  66. }
  67. }
  68. export default translate(
  69. connect(abstractMapStateToProps)(UserMediaPermissionsOverlay));