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.

Labels.native.js 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. // @flow
  2. import React from 'react';
  3. import { View } from 'react-native';
  4. import { connect } from 'react-redux';
  5. import { JitsiRecordingConstants } from '../../base/lib-jitsi-meet';
  6. import {
  7. isNarrowAspectRatio,
  8. makeAspectRatioAware
  9. } from '../../base/responsive-ui';
  10. import { isFilmstripVisible } from '../../filmstrip';
  11. import AbstractLabels, { type Props } from './AbstractLabels';
  12. import styles from './styles';
  13. /**
  14. * A container that renders the conference indicators, if any.
  15. */
  16. class Labels extends AbstractLabels<Props, *> {
  17. /**
  18. * Implements React {@code Component}'s render.
  19. *
  20. * @inheritdoc
  21. */
  22. render() {
  23. const _wide = !isNarrowAspectRatio(this);
  24. const { _filmstripVisible } = this.props;
  25. return (
  26. <View
  27. pointerEvents = 'box-none'
  28. style = { [
  29. styles.indicatorContainer,
  30. _wide && _filmstripVisible && styles.indicatorContainerWide
  31. ] }>
  32. {
  33. this._renderRecordingLabel(
  34. JitsiRecordingConstants.mode.FILE)
  35. }
  36. {
  37. this._renderRecordingLabel(
  38. JitsiRecordingConstants.mode.STREAM)
  39. }
  40. {
  41. this._renderVideoQualityLabel()
  42. }
  43. </View>
  44. );
  45. }
  46. _renderRecordingLabel: string => React$Element<*>
  47. _renderVideoQualityLabel: () => React$Element<*>
  48. }
  49. /**
  50. * Maps (parts of) the redux state to the associated
  51. * {@code Labels}'s props.
  52. *
  53. * @param {Object} state - The redux state.
  54. * @private
  55. * @returns {{
  56. * _filmstripVisible: boolean
  57. * }}
  58. */
  59. function _mapStateToProps(state) {
  60. return {
  61. /**
  62. * The indicator which determines whether the filmstrip is visible.
  63. *
  64. * @private
  65. * @type {boolean}
  66. */
  67. _filmstripVisible: isFilmstripVisible(state)
  68. };
  69. }
  70. export default connect(_mapStateToProps)(
  71. makeAspectRatioAware(Labels)
  72. );