diff --git a/css/modals/invite/_invite.scss b/css/modals/invite/_invite.scss index f2edd559a..7619b227b 100644 --- a/css/modals/invite/_invite.scss +++ b/css/modals/invite/_invite.scss @@ -32,7 +32,7 @@ .dial-in-numbers-trigger-icon { position: absolute; - right: 0; + right: 10px; top: 4px; } } @@ -47,6 +47,22 @@ .form-control { padding: 0; + + &__container { + /** + * Ensure contents display in a line and vertically centered. + */ + align-items: center; + + button { + font-size: $modalButtonFontSize; + } + } + + &__input-container { + flex: 1; + margin-right: 10px; + } } .inviteLink { diff --git a/react/features/dial-out/components/DialOutNumbersForm.web.js b/react/features/dial-out/components/DialOutNumbersForm.web.js index 899c43e25..f47a48e26 100644 --- a/react/features/dial-out/components/DialOutNumbersForm.web.js +++ b/react/features/dial-out/components/DialOutNumbersForm.web.js @@ -1,7 +1,6 @@ import { StatelessDropdownMenu } from '@atlaskit/dropdown-menu'; import AKFieldText, { FieldText } from '@atlaskit/field-text'; import ExpandIcon from '@atlaskit/icon/glyph/expand'; -import { noop as _onNoop } from 'lodash'; import React, { Component } from 'react'; import { connect } from 'react-redux'; @@ -96,6 +95,8 @@ class DialOutNumbersForm extends Component { this._dialInputElem = null; // Bind event handlers so they are only bound once for every instance. + this._onDropdownTriggerInputChange + = this._onDropdownTriggerInputChange.bind(this); this._onInputChange = this._onInputChange.bind(this); this._onOpenChange = this._onOpenChange.bind(this); this._onSelect = this._onSelect.bind(this); @@ -209,7 +210,7 @@ class DialOutNumbersForm extends Component { isLabelHidden = { true } isReadOnly = { true } label = 'dial-out-code' - onChange = { _onNoop } + onChange = { this._onDropdownTriggerInputChange } type = 'text' value = { dialCode || '' } /> @@ -256,6 +257,18 @@ class DialOutNumbersForm extends Component { this.props.onChange(dialCode, this.state.dialInput); } + /** + * This is a no-op function used to stub out FieldText's onChange in order + * to prevent FieldText from printing prop type validation errors. FieldText + * is used as a trigger for the dropdown in {@code DialOutNumbersForm} to + * get the desired AtlasKit input look for the UI. + * + * @returns {void} + */ + _onDropdownTriggerInputChange() { + // Intentionally left empty. + } + /** * Updates the dialInput state when the input changes. * diff --git a/react/features/invite/components/AddPasswordForm.js b/react/features/invite/components/AddPasswordForm.js index 16503b9cc..4967e5b22 100644 --- a/react/features/invite/components/AddPasswordForm.js +++ b/react/features/invite/components/AddPasswordForm.js @@ -1,3 +1,5 @@ +import Button from '@atlaskit/button'; +import { FieldText } from '@atlaskit/field-text'; import React, { Component } from 'react'; import { connect } from 'react-redux'; @@ -52,10 +54,40 @@ class AddPasswordForm extends Component { password: '' }; + /** + * The internal reference to the React {@code component} for entering a + * password. + * + * @private + * @type {ReactComponent} + */ + this._inputComponent = null; + // Bind event handlers so they are only bound once for every instance. this._onKeyDown = this._onKeyDown.bind(this); this._onPasswordChange = this._onPasswordChange.bind(this); this._onSubmit = this._onSubmit.bind(this); + this._setInput = this._setInput.bind(this); + } + + /** + * Directly bind a handler to the input element. This is done in order to + * intercept enter presses so any outer forms do not become submitted. + * Atlaskit Button does not expose a way to hook onto keydown events. + * + * @inheritdoc + */ + componentDidMount() { + this._inputComponent.input.onkeydown = this._onKeyDown; + } + + /** + * Remove any handlers set directly on DOM elements. + * + * @inheritdoc + */ + componentWillUnmount() { + this._inputComponent.input.onkeydown = null; } /** @@ -72,22 +104,28 @@ class AddPasswordForm extends Component { className = 'form-control' onSubmit = { this._onSubmit } >
- -
+ + ); @@ -141,6 +179,21 @@ class AddPasswordForm extends Component { this.setState({ password: '' }); } + + /** + * Sets the instance variable for the React Component used for entering a + * password. + * + * @param {Object} inputComponent - The React Component for the input + * field. + * @private + * @returns {void} + */ + _setInput(inputComponent) { + if (inputComponent !== this._inputComponent) { + this._inputComponent = inputComponent; + } + } } export default translate(connect()(AddPasswordForm)); diff --git a/react/features/invite/components/DialInNumbersForm.js b/react/features/invite/components/DialInNumbersForm.js index b5f439d68..2325a5524 100644 --- a/react/features/invite/components/DialInNumbersForm.js +++ b/react/features/invite/components/DialInNumbersForm.js @@ -1,4 +1,6 @@ +import Button from '@atlaskit/button'; import { StatelessDropdownMenu } from '@atlaskit/dropdown-menu'; +import { FieldText } from '@atlaskit/field-text'; import ExpandIcon from '@atlaskit/icon/glyph/expand'; import React, { Component } from 'react'; import { connect } from 'react-redux'; @@ -92,6 +94,8 @@ class DialInNumbersForm extends Component { // Bind event handlers so they are only bound once for every instance. this._onCopyClick = this._onCopyClick.bind(this); + this._onDropdownTriggerInputChange + = this._onDropdownTriggerInputChange.bind(this); this._onOpenChange = this._onOpenChange.bind(this); this._onSelect = this._onSelect.bind(this); this._setCopyElement = this._setCopyElement.bind(this); @@ -154,12 +158,13 @@ class DialInNumbersForm extends Component {
{ this._createDropdownMenu(items, selectedNumber.content) } - + { t('dialog.copy') } +