import React, { Component } from 'react'; import { translate } from '../../base/i18n'; import { LOCKED_LOCALLY } from '../../room-lock'; import AddPasswordForm from './AddPasswordForm'; import LockStatePanel from './LockStatePanel'; import RemovePasswordForm from './RemovePasswordForm'; /** * React {@code Component} for displaying the current room lock state as well as * exposing features to modify the room lock. */ class PasswordContainer extends Component { /** * {@code PasswordContainer}'s property types. * * @static */ static propTypes = { /** * The JitsiConference for which to display a lock state and change the * password. * * @type {JitsiConference} */ conference: React.PropTypes.object, /** * The value for how the conference is locked (or undefined if not * locked) as defined by room-lock constants. */ locked: React.PropTypes.string, /** * The current known password for the JitsiConference. */ password: React.PropTypes.string, /** * Whether or not the password editing components should be displayed. */ showPasswordEdit: React.PropTypes.bool, /** * Invoked to obtain translated strings. */ t: React.PropTypes.func }; /** * Initializes a new {@code PasswordContainer} instance. * * @param {Object} props - The read-only properties with which the new * instance is to be initialized. */ constructor(props) { super(props); this.state = { /** * Whether or not the form to edit the password should display. If * true, the form should display. * * @type {boolean} */ isEditingPassword: false }; // Bind event handlers so they are only bound once for every instance. this._onTogglePasswordEdit = this._onTogglePasswordEdit.bind(this); } /** * Implements React's {@link Component#render()}. * * @inheritdoc * @returns {ReactElement} */ render() { return (