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.

AbstractLabels.js 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. // @flow
  2. import React, { Component } from 'react';
  3. import { isFilmstripVisible } from '../../filmstrip';
  4. import { RecordingLabel } from '../../recording';
  5. import { VideoQualityLabel } from '../../video-quality';
  6. import { TranscribingLabel } from '../../transcribing/';
  7. /**
  8. * The type of the React {@code Component} props of {@link AbstractLabels}.
  9. */
  10. export type Props = {
  11. /**
  12. * Whether or not the filmstrip is displayed with remote videos. Used to
  13. * determine display classes to set.
  14. */
  15. _filmstripVisible: boolean,
  16. };
  17. /**
  18. * A container to hold video status labels, including recording status and
  19. * current large video quality.
  20. *
  21. * @extends Component
  22. */
  23. export default class AbstractLabels<P: Props, S> extends Component<P, S> {
  24. /**
  25. * Renders the {@code RecordingLabel} that is platform independent.
  26. *
  27. * @protected
  28. * @param {string} mode - The recording mode that this label is rendered
  29. * for.
  30. * @returns {React$Element}
  31. */
  32. _renderRecordingLabel(mode: string) {
  33. return (
  34. <RecordingLabel mode = { mode } />
  35. );
  36. }
  37. /**
  38. * Renders the {@code VideoQualityLabel} that is platform independent.
  39. *
  40. * @protected
  41. * @returns {React$Element}
  42. */
  43. _renderVideoQualityLabel() {
  44. return (
  45. <VideoQualityLabel />
  46. );
  47. }
  48. /**
  49. * Renders the {@code TranscribingLabel}.
  50. *
  51. * @returns {React$Element}
  52. * @protected
  53. */
  54. _renderTranscribingLabel() {
  55. return (
  56. <TranscribingLabel />
  57. );
  58. }
  59. }
  60. /**
  61. * Maps (parts of) the Redux state to the associated props for the
  62. * {@code Labels} component.
  63. *
  64. * @param {Object} state - The Redux state.
  65. * @private
  66. * @returns {{
  67. * _filmstripVisible: boolean
  68. * }}
  69. */
  70. export function _abstractMapStateToProps(state: Object) {
  71. return {
  72. _filmstripVisible: isFilmstripVisible(state)
  73. };
  74. }