import Button from '@atlaskit/button'; import { FieldText } from '@atlaskit/field-text'; import React, { Component } from 'react'; import { translate } from '../../base/i18n'; const logger = require('jitsi-meet-logger').getLogger(__filename); /** * A React {@code Component} for displaying a value with a copy button to copy * the value into the clipboard. */ class ShareLinkForm extends Component { /** * {@code ShareLinkForm}'s property types. * * @static */ static propTypes = { /** * Invoked to obtain translated strings. */ t: React.PropTypes.func, /** * The value to be displayed and copied into the clipboard. */ toCopy: React.PropTypes.string }; /** * Initializes a new {@code ShareLinkForm} instance. * * @param {Object} props - The read-only properties with which the new * instance is to be initialized. */ constructor(props) { super(props); /** * The internal reference to the React {@code component} for display * the meeting link in an input element. * * @private * @type {ReactComponent} */ this._inputComponent = null; // Bind event handlers so they are only bound once for every instance. this._onClick = this._onClick.bind(this); this._onDropdownTriggerInputChange = this._onDropdownTriggerInputChange.bind(this); this._setInput = this._setInput.bind(this); } /** * Implements React's {@link Component#render()}. * * @inheritdoc * @returns {ReactElement} */ render() { const { t } = this.props; const inputValue = this.props.toCopy || t('inviteUrlDefaultMsg'); return (