Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

UserMediaPermissionsOverlay.js 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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 { _premeetingBackground, browser, t } = this.props;
  22. const style = _premeetingBackground ? {
  23. background: _premeetingBackground,
  24. backgroundPosition: 'center',
  25. backgroundSize: 'cover'
  26. } : {};
  27. return (
  28. <OverlayFrame style = { style }>
  29. <div className = 'inlay'>
  30. <span className = 'inlay__icon icon-microphone' />
  31. <span className = 'inlay__icon icon-camera' />
  32. <h3
  33. aria-label = { t('startupoverlay.genericTitle') }
  34. className = 'inlay__title'
  35. role = 'alert' >
  36. {
  37. t('startupoverlay.genericTitle')
  38. }
  39. </h3>
  40. <span
  41. className = 'inlay__text'
  42. role = 'alert' >
  43. {
  44. translateToHTML(t,
  45. `userMedia.${browser}GrantPermissions`)
  46. }
  47. </span>
  48. </div>
  49. <div className = 'policy overlay__policy'>
  50. <p
  51. className = 'policy__text'
  52. role = 'alert'>
  53. { translateToHTML(t, 'startupoverlay.policyText') }
  54. </p>
  55. {
  56. this._renderPolicyLogo()
  57. }
  58. </div>
  59. </OverlayFrame>
  60. );
  61. }
  62. /**
  63. * Renders the policy logo.
  64. *
  65. * @private
  66. * @returns {ReactElement|null}
  67. */
  68. _renderPolicyLogo() {
  69. const policyLogoSrc = interfaceConfig.POLICY_LOGO;
  70. if (policyLogoSrc) {
  71. return (
  72. <div className = 'policy__logo'>
  73. <img
  74. alt = { this.props.t('welcomepage.logo.policyLogo') }
  75. src = { policyLogoSrc } />
  76. </div>
  77. );
  78. }
  79. return null;
  80. }
  81. }
  82. /**
  83. * Maps (parts of) the redux state to the React {@code Component} props.
  84. *
  85. * @param {Object} state - The redux state.
  86. * @param {Object} ownProps - The props passed to the component.
  87. * @returns {Object}
  88. */
  89. function mapStateToProps(state): Object {
  90. const { premeetingBackground } = state['features/dynamic-branding'];
  91. return {
  92. ...abstractMapStateToProps(state),
  93. _premeetingBackground: premeetingBackground
  94. };
  95. }
  96. export default translate(
  97. connect(mapStateToProps)(UserMediaPermissionsOverlay));