您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

LockStatePanel.js 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import React, { Component } from 'react';
  2. import { translate } from '../../base/i18n';
  3. /**
  4. * A React Component for displaying the conference lock state.
  5. */
  6. class LockStatePanel extends Component {
  7. /**
  8. * {@code LockStatePanel}'s property types.
  9. *
  10. * @static
  11. */
  12. static propTypes = {
  13. /**
  14. * Whether or not the conference is currently locked.
  15. */
  16. locked: React.PropTypes.bool,
  17. /**
  18. * Invoked to obtain translated strings.
  19. */
  20. t: React.PropTypes.func
  21. };
  22. /**
  23. * Implements React's {@link Component#render()}.
  24. *
  25. * @inheritdoc
  26. * @returns {ReactElement}
  27. */
  28. render() {
  29. let iconClass;
  30. let stateClass;
  31. let textKey;
  32. if (this.props.locked) {
  33. iconClass = 'icon-security-locked';
  34. stateClass = 'is-locked';
  35. textKey = 'invite.locked';
  36. } else {
  37. iconClass = 'icon-security';
  38. stateClass = 'is-unlocked';
  39. textKey = 'invite.unlocked';
  40. }
  41. return (
  42. <div className = { `lock-state ${stateClass}` }>
  43. <span className = { iconClass } />
  44. <span>
  45. { this.props.t(textKey) }
  46. </span>
  47. </div>
  48. );
  49. }
  50. }
  51. export default translate(LockStatePanel);