import React, { Component } from 'react'; import { connect } from 'react-redux'; import { setPassword } from '../../base/conference'; import { translate } from '../../base/i18n'; /** * A React Component for locking a JitsiConference with a password. */ class AddPasswordForm extends Component { /** * AddPasswordForm component's property types. * * @static */ static propTypes = { /** * The JitsiConference on which to lock and set a password. * * @type {JitsiConference} */ conference: React.PropTypes.object, /** * Invoked to set a password on the conference. */ dispatch: React.PropTypes.func, /** * Invoked to obtain translated strings. */ t: React.PropTypes.func } /** * Initializes a new AddPasswordForm instance. * * @param {Object} props - The read-only properties with which the new * instance is to be initialized. */ constructor(props) { super(props); this.state = { password: '' }; this._onKeyDown = this._onKeyDown.bind(this); this._onPasswordChange = this._onPasswordChange.bind(this); this._onSubmit = this._onSubmit.bind(this); } /** * Implements React's {@link Component#render()}. * * @inheritdoc * @returns {ReactElement} */ render() { return (