diff --git a/react/features/base/known-domains/reducer.js b/react/features/base/known-domains/reducer.js index 3de77d160..544d15747 100644 --- a/react/features/base/known-domains/reducer.js +++ b/react/features/base/known-domains/reducer.js @@ -61,8 +61,7 @@ function _addKnownDomains(state, knownDomains) { nextState = Array.from(state); for (let knownDomain of knownDomains) { knownDomain = knownDomain.toLowerCase(); - nextState.indexOf(knownDomain) === -1 - && nextState.push(knownDomain); + !nextState.includes(knownDomain) && nextState.push(knownDomain); } } diff --git a/react/features/settings/components/native/FormRow.js b/react/features/settings/components/native/FormRow.js index f51beee49..395a44d09 100644 --- a/react/features/settings/components/native/FormRow.js +++ b/react/features/settings/components/native/FormRow.js @@ -25,7 +25,7 @@ type Props = { /** * The i18n key of the text label of the form field. */ - i18nLabel: string, + label: string, /** * Invoked to obtain translated strings. @@ -78,7 +78,7 @@ class FormRow extends Component { styles.text, styles.fieldLabelText ] } > - { t(this.props.i18nLabel) } + { t(this.props.label) } diff --git a/react/features/settings/components/native/FormSectionHeader.js b/react/features/settings/components/native/FormSectionHeader.js index 7b7897825..7497ef871 100644 --- a/react/features/settings/components/native/FormSectionHeader.js +++ b/react/features/settings/components/native/FormSectionHeader.js @@ -15,7 +15,7 @@ type Props = { /** * The i18n key of the text label of the section. */ - i18nLabel: string, + label: string, /** * An external style object passed to the component. @@ -41,7 +41,7 @@ class FormSectionHeader extends Component { * @returns {ReactElement} */ render() { - const { i18nLabel, style, t } = this.props; + const { label, style, t } = this.props; return ( { style ] } > - { t(i18nLabel) } + { t(label) } ); diff --git a/react/features/settings/components/native/SettingsView.js b/react/features/settings/components/native/SettingsView.js index 36974e45f..3c94157c8 100644 --- a/react/features/settings/components/native/SettingsView.js +++ b/react/features/settings/components/native/SettingsView.js @@ -146,17 +146,17 @@ class SettingsView extends AbstractSettingsView { + label = 'settingsView.profileSection' /> + label = 'settingsView.displayName'> - + + label = 'settingsView.conferenceSection' /> + label = 'settingsView.serverURL'> + label = 'settingsView.startWithAudioMuted'> - + diff --git a/react/features/welcome/components/SideBarItem.js b/react/features/welcome/components/SideBarItem.js index bafefb03b..842bb43d9 100644 --- a/react/features/welcome/components/SideBarItem.js +++ b/react/features/welcome/components/SideBarItem.js @@ -10,16 +10,16 @@ import styles from './styles'; type Props = { - /** - * The i18n label of the item. - */ - i18Label: string, - /** * The icon of the item. */ icon: string, + /** + * The i18n label of the item. + */ + label: string, + /** * The function to be invoked when the item is pressed * if the item is a button. @@ -61,7 +61,7 @@ class SideBarItem extends Component { * @returns {ReactElement} */ render() { - const { onPress, t } = this.props; + const { label, onPress, t } = this.props; const onPressCalculated = typeof onPress === 'function' ? onPress : this._onOpenURL; @@ -74,7 +74,7 @@ class SideBarItem extends Component { name = { this.props.icon } style = { styles.sideBarItemIcon } /> - { t(this.props.i18Label) } + { t(label) } diff --git a/react/features/welcome/components/WelcomePage.native.js b/react/features/welcome/components/WelcomePage.native.js index 1ac71b442..e5feab817 100644 --- a/react/features/welcome/components/WelcomePage.native.js +++ b/react/features/welcome/components/WelcomePage.native.js @@ -47,10 +47,13 @@ class WelcomePage extends AbstractWelcomePage { this.state.hintBoxAnimation = new Animated.Value(0); // Bind event handlers so they are only bound once per instance. - this._getHintBoxStyle = this._getHintBoxStyle.bind(this); this._onFieldFocusChange = this._onFieldFocusChange.bind(this); this._onShowSideBar = this._onShowSideBar.bind(this); this._renderHintBox = this._renderHintBox.bind(this); + + // Specially bind functions to avoid function definition on render. + this._onFieldBlur = this._onFieldFocusChange.bind(this, false); + this._onFieldFocus = this._onFieldFocusChange.bind(this, true); } /** @@ -103,9 +106,9 @@ class WelcomePage extends AbstractWelcomePage { autoComplete = { false } autoCorrect = { false } autoFocus = { false } - onBlur = { this._onFieldFocusChange(false) } + onBlur = { this._onFieldBlur } onChangeText = { this._onRoomChange } - onFocus = { this._onFieldFocusChange(true) } + onFocus = { this._onFieldFocus } onSubmitEditing = { this._onJoin } placeholder = { t('welcomepage.roomname') } placeholderTextColor = { @@ -149,28 +152,26 @@ class WelcomePage extends AbstractWelcomePage { * * @private * @param {boolean} focused - The focused state of the field. - * @returns {Function} + * @returns {void} */ _onFieldFocusChange(focused) { - return () => { - focused - && this.setState({ - _fieldFocused: true - }); + focused + && this.setState({ + _fieldFocused: true + }); - Animated.timing( - this.state.hintBoxAnimation, - { - duration: 300, - toValue: focused ? 1 : 0 - }) - .start(animationState => - animationState.finished - && !focused - && this.setState({ - _fieldFocused: false - })); - }; + Animated.timing( + this.state.hintBoxAnimation, + { + duration: 300, + toValue: focused ? 1 : 0 + }) + .start(animationState => + animationState.finished + && !focused + && this.setState({ + _fieldFocused: false + })); } /** diff --git a/react/features/welcome/components/WelcomePageSideBar.native.js b/react/features/welcome/components/WelcomePageSideBar.native.js index c76a10ef3..27de05007 100644 --- a/react/features/welcome/components/WelcomePageSideBar.native.js +++ b/react/features/welcome/components/WelcomePageSideBar.native.js @@ -45,7 +45,7 @@ type Props = { /** * The avatar URL to be rendered. */ - _avatar: string, + _avatarURL: string, /** * Display name of the local participant. @@ -90,7 +90,7 @@ class WelcomePageSideBar extends Component { + uri = { this.props._avatarURL } /> { this.props._displayName } @@ -99,20 +99,20 @@ class WelcomePageSideBar extends Component { @@ -153,13 +153,17 @@ class WelcomePageSideBar extends Component { * * @param {Object} state - The redux state. * @protected - * @returns {Object} + * @returns {{ + * _avatarURL: string, + * _displayName: string, + * _visible: boolean + * }} */ function _mapStateToProps(state: Object) { const localParticipant = getLocalParticipant(state); return { - _avatar: getAvatarURL(localParticipant), + _avatarURL: getAvatarURL(localParticipant), _displayName: getParticipantDisplayName(state, localParticipant.id), _visible: state['features/welcome'].sideBarVisible };