您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

AbstractLabels.js 1.6KB

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