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.tsx 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. import React from 'react';
  2. import { connect } from 'react-redux';
  3. import { IReduxState } from '../../../app/types';
  4. import { translate, translateToHTML } from '../../../base/i18n/functions';
  5. import AbstractUserMediaPermissionsOverlay, { abstractMapStateToProps }
  6. from './AbstractUserMediaPermissionsOverlay';
  7. import OverlayFrame from './OverlayFrame';
  8. /**
  9. * Implements a React Component for overlay with guidance how to proceed with
  10. * gUM prompt.
  11. */
  12. class UserMediaPermissionsOverlay extends AbstractUserMediaPermissionsOverlay {
  13. /**
  14. * Implements React's {@link Component#render()}.
  15. *
  16. * @inheritdoc
  17. * @returns {ReactElement}
  18. */
  19. render() {
  20. const { _premeetingBackground, browser, t } = this.props;
  21. const style = _premeetingBackground ? {
  22. background: _premeetingBackground,
  23. backgroundPosition: 'center',
  24. backgroundSize: 'cover'
  25. } : {};
  26. return (
  27. <OverlayFrame style = { style }>
  28. <div className = 'inlay'>
  29. <span className = 'inlay__icon icon-microphone' />
  30. <span className = 'inlay__icon icon-camera' />
  31. <h3
  32. aria-label = { t('startupoverlay.genericTitle') }
  33. className = 'inlay__title'
  34. role = 'alert' >
  35. {
  36. t('startupoverlay.genericTitle')
  37. }
  38. </h3>
  39. <span
  40. className = 'inlay__text'
  41. role = 'alert' >
  42. {
  43. translateToHTML(t,
  44. `userMedia.${browser}GrantPermissions`)
  45. }
  46. </span>
  47. </div>
  48. <div className = 'policy overlay__policy'>
  49. <p
  50. className = 'policy__text'
  51. role = 'alert'>
  52. { translateToHTML(t, 'startupoverlay.policyText') }
  53. </p>
  54. {
  55. this._renderPolicyLogo()
  56. }
  57. </div>
  58. </OverlayFrame>
  59. );
  60. }
  61. /**
  62. * Renders the policy logo.
  63. *
  64. * @private
  65. * @returns {ReactElement|null}
  66. */
  67. _renderPolicyLogo() {
  68. const policyLogoSrc = interfaceConfig.POLICY_LOGO;
  69. if (policyLogoSrc) {
  70. return (
  71. <div className = 'policy__logo'>
  72. <img
  73. alt = { this.props.t('welcomepage.logo.policyLogo') }
  74. src = { policyLogoSrc } />
  75. </div>
  76. );
  77. }
  78. return null;
  79. }
  80. }
  81. /**
  82. * Maps (parts of) the redux state to the React {@code Component} props.
  83. *
  84. * @param {Object} state - The redux state.
  85. * @param {Object} ownProps - The props passed to the component.
  86. * @returns {Object}
  87. */
  88. function mapStateToProps(state: IReduxState) {
  89. const { premeetingBackground } = state['features/dynamic-branding'];
  90. return {
  91. ...abstractMapStateToProps(state),
  92. _premeetingBackground: premeetingBackground
  93. };
  94. }
  95. export default translate(connect(mapStateToProps)(UserMediaPermissionsOverlay));