jiti-meet/react/features/recording/components/RecordingLabel.native.js

55 lines
1.4 KiB
JavaScript
Raw Normal View History

// @flow
import React from 'react';
import { connect } from 'react-redux';
import { translate } from '../../base/i18n';
import { CircularLabel } from '../../base/label';
import { JitsiRecordingConstants } from '../../base/lib-jitsi-meet';
import AbstractRecordingLabel, {
2018-06-14 09:15:36 +00:00
type Props,
_mapStateToProps
} from './AbstractRecordingLabel';
import styles from './styles';
/**
* Implements a React {@link Component} which displays the current state of
* conference recording.
*
* @extends {Component}
*/
2018-06-14 09:15:36 +00:00
class RecordingLabel extends AbstractRecordingLabel<Props> {
/**
2018-06-14 09:15:36 +00:00
* Renders the platform specific label component.
*
* @inheritdoc
*/
2018-06-14 09:15:36 +00:00
_renderLabel() {
let indicatorStyle;
2018-06-14 09:15:36 +00:00
switch (this.props.mode) {
case JitsiRecordingConstants.mode.STREAM:
indicatorStyle = styles.indicatorLive;
break;
case JitsiRecordingConstants.mode.FILE:
indicatorStyle = styles.indicatorRecording;
break;
default:
// Invalid mode is passed to the component.
return null;
}
return (
<CircularLabel
2018-06-14 09:15:36 +00:00
label = { this.props.t(this._getLabelKey()) }
style = { indicatorStyle } />
);
}
2018-06-14 09:15:36 +00:00
_getLabelKey: () => ?string
}
export default translate(connect(_mapStateToProps)(RecordingLabel));