Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

AbstractUserMediaPermissionsOverlay.ts 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import { Component } from 'react';
  2. import { WithTranslation } from 'react-i18next';
  3. import { IReduxState } from '../../../app/types';
  4. /**
  5. * The type of the React {@code Component} props of
  6. * {@link AbstractUserMediaPermissionsOverlay}.
  7. */
  8. interface IProps extends WithTranslation {
  9. /**
  10. * The browser which is used currently. The text is different for every
  11. * browser.
  12. */
  13. browser: string;
  14. }
  15. /**
  16. * Implements a React {@link Component} for overlay with guidance how to proceed
  17. * with gUM prompt.
  18. */
  19. export default class AbstractUserMediaPermissionsOverlay
  20. extends Component<IProps> {
  21. /**
  22. * Determines whether this overlay needs to be rendered (according to a
  23. * specific redux state). Called by {@link OverlayContainer}.
  24. *
  25. * @param {Object} state - The redux state.
  26. * @returns {boolean} - If this overlay needs to be rendered, {@code true};
  27. * {@code false}, otherwise.
  28. */
  29. static needsRender(state: IReduxState) {
  30. return state['features/overlay'].isMediaPermissionPromptVisible;
  31. }
  32. }
  33. /**
  34. * Maps (parts of) the redux state to the associated component's props.
  35. *
  36. * @param {Object} state - The redux state.
  37. * @protected
  38. * @returns {{
  39. * browser: string
  40. * }}
  41. */
  42. export function abstractMapStateToProps(state: IReduxState) {
  43. const { browser } = state['features/overlay'];
  44. return {
  45. browser
  46. };
  47. }