Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

LockStatePanel.js 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. * LockStatePanel component'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. const [ lockStateClass, lockIconClass, lockTextKey ] = this.props.locked
  30. ? [ 'is-locked', 'icon-security-locked', 'invite.locked' ]
  31. : [ 'is-unlocked', 'icon-security', 'invite.unlocked' ];
  32. return (
  33. <div className = { `lock-state ${lockStateClass}` }>
  34. <span className = { lockIconClass } />
  35. <span>
  36. { this.props.t(lockTextKey) }
  37. </span>
  38. </div>
  39. );
  40. }
  41. }
  42. export default translate(LockStatePanel);