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.

RecordingLabel.native.js 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // @flow
  2. import React from 'react';
  3. import { connect } from 'react-redux';
  4. import { translate } from '../../base/i18n';
  5. import { CircularLabel } from '../../base/label';
  6. import { JitsiRecordingConstants } from '../../base/lib-jitsi-meet';
  7. import AbstractRecordingLabel, {
  8. type Props,
  9. _mapStateToProps
  10. } from './AbstractRecordingLabel';
  11. import styles from './styles';
  12. /**
  13. * Implements a React {@link Component} which displays the current state of
  14. * conference recording.
  15. *
  16. * @extends {Component}
  17. */
  18. class RecordingLabel extends AbstractRecordingLabel<Props> {
  19. /**
  20. * Renders the platform specific label component.
  21. *
  22. * @inheritdoc
  23. */
  24. _renderLabel() {
  25. let indicatorStyle;
  26. switch (this.props.mode) {
  27. case JitsiRecordingConstants.mode.STREAM:
  28. indicatorStyle = styles.indicatorLive;
  29. break;
  30. case JitsiRecordingConstants.mode.FILE:
  31. indicatorStyle = styles.indicatorRecording;
  32. break;
  33. default:
  34. // Invalid mode is passed to the component.
  35. return null;
  36. }
  37. return (
  38. <CircularLabel
  39. label = { this.props.t(this._getLabelKey()) }
  40. style = { indicatorStyle } />
  41. );
  42. }
  43. _getLabelKey: () => ?string
  44. }
  45. export default translate(connect(_mapStateToProps)(RecordingLabel));