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.

AbstractConference.js 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. // @flow
  2. import React, { Component } from 'react';
  3. import { NotificationsContainer } from '../../notifications/components';
  4. import { shouldDisplayNotifications } from '../functions';
  5. import { shouldDisplayTileView } from '../../video-layout';
  6. /**
  7. * The type of the React {@code Component} props of {@link AbstractLabels}.
  8. */
  9. export type AbstractProps = {
  10. /**
  11. * Set to {@code true} when the notifications are to be displayed.
  12. *
  13. * @protected
  14. * @type {boolean}
  15. */
  16. _notificationsVisible: boolean,
  17. /**
  18. * Conference room name.
  19. *
  20. * @protected
  21. * @type {string}
  22. */
  23. _room: string,
  24. /**
  25. * Whether or not the layout should change to support tile view mode.
  26. *
  27. * @protected
  28. * @type {boolean}
  29. */
  30. _shouldDisplayTileView: boolean
  31. };
  32. /**
  33. * A container to hold video status labels, including recording status and
  34. * current large video quality.
  35. *
  36. * @extends Component
  37. */
  38. export class AbstractConference<P: AbstractProps, S>
  39. extends Component<P, S> {
  40. /**
  41. * Renders the {@code LocalRecordingLabel}.
  42. *
  43. * @param {Object} props - The properties to be passed to
  44. * the {@code NotificationsContainer}.
  45. * @protected
  46. * @returns {React$Element}
  47. */
  48. renderNotificationsContainer(props: ?Object) {
  49. if (this.props._notificationsVisible) {
  50. return (
  51. React.createElement(NotificationsContainer, props)
  52. );
  53. }
  54. return null;
  55. }
  56. }
  57. /**
  58. * Maps (parts of) the redux state to the associated props of the {@link Labels}
  59. * {@code Component}.
  60. *
  61. * @param {Object} state - The redux state.
  62. * @private
  63. * @returns {AbstractProps}
  64. */
  65. export function abstractMapStateToProps(state: Object) {
  66. return {
  67. _notificationsVisible: shouldDisplayNotifications(state),
  68. _room: state['features/base/conference'].room,
  69. _shouldDisplayTileView: shouldDisplayTileView(state)
  70. };
  71. }