2017-04-13 00:23:43 +00:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
|
|
|
import { translate } from '../../base/i18n';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A React Component for displaying the conference lock state.
|
|
|
|
*/
|
|
|
|
class LockStatePanel extends Component {
|
|
|
|
/**
|
2017-04-18 21:49:52 +00:00
|
|
|
* {@code LockStatePanel}'s property types.
|
2017-04-13 00:23:43 +00:00
|
|
|
*
|
|
|
|
* @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() {
|
2017-04-18 21:49:52 +00:00
|
|
|
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';
|
|
|
|
}
|
2017-04-13 00:23:43 +00:00
|
|
|
|
|
|
|
return (
|
2017-04-18 21:49:52 +00:00
|
|
|
<div className = { `lock-state ${stateClass}` }>
|
|
|
|
<span className = { iconClass } />
|
2017-04-13 00:23:43 +00:00
|
|
|
<span>
|
2017-04-18 21:49:52 +00:00
|
|
|
{ this.props.t(textKey) }
|
2017-04-13 00:23:43 +00:00
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default translate(LockStatePanel);
|