import React, { Component } from 'react'; import { translate } from '../../base/i18n'; const logger = require('jitsi-meet-logger').getLogger(__filename); /** * A React Component for displaying a value with a copy button that can be * clicked to copy the value onto the clipboard. */ class ShareLinkForm extends Component { /** * ShareLinkForm component's property types. * * @static */ static propTypes = { /** * Invoked to obtain translated strings. */ t: React.PropTypes.func, /** * The value to be displayed and copied onto the clipboard. */ toCopy: React.PropTypes.string } /** * Initializes a new ShareLinkForm instance. * * @param {Object} props - The read-only properties with which the new * instance is to be initialized. */ constructor(props) { super(props); this._inputElement = null; this._onClick = this._onClick.bind(this); this._setInput = this._setInput.bind(this); } /** * Implements React's {@link Component#render()}. * * @inheritdoc * @returns {ReactElement} */ render() { const inputValue = this.props.toCopy || this.props.t('inviteUrlDefaultMsg'); // FIXME input is used here instead of atlaskit field-text because // field-text does not currently support readonly return (