Files
jitsi-meet/react/features/invite/components/LockStatePanel.js
Lyubo Marinov 55c3f5ddff Comply w/ coding style
@virtuacoplenny, the changes of this commit are not necessarily in
source code that you introduced in
https://github.com/jitsi/jitsi-meet/pull/1499 but I saw violations in
files modified in the PR which I had to read in order to understand the
PR.
2017-04-19 20:56:19 -05:00

59 lines
1.3 KiB
JavaScript

import React, { Component } from 'react';
import { translate } from '../../base/i18n';
/**
* A React Component for displaying the conference lock state.
*/
class LockStatePanel extends Component {
/**
* {@code LockStatePanel}'s property types.
*
* @static
*/
static propTypes = {
/**
* Whether or not the conference is currently locked.
*/
locked: React.PropTypes.bool,
/**
* Invoked to obtain translated strings.
*/
t: React.PropTypes.func
}
/**
* Implements React's {@link Component#render()}.
*
* @inheritdoc
* @returns {ReactElement}
*/
render() {
let iconClass;
let stateClass;
let textKey;
if (this.props.locked) {
iconClass = 'icon-security-locked';
stateClass = 'is-locked';
textKey = 'invite.locked';
} else {
iconClass = 'icon-security';
stateClass = 'is-unlocked';
textKey = 'invite.unlocked';
}
return (
<div className = { `lock-state ${stateClass}` }>
<span className = { iconClass } />
<span>
{ this.props.t(textKey) }
</span>
</div>
);
}
}
export default translate(LockStatePanel);