Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

invite: merge InviteButton and InfoDialogButton on mobile

Saúl Ibarra Corretgé8cd881945a58
diff --git a/react/features/invite/components/add-people-dialog/native/InviteButton.js b/react/features/invite/components/add-people-dialog/native/InviteButton.js
index 1a3949f285..57bc0f1639 100644
--- a/react/features/invite/components/add-people-dialog/native/InviteButton.js
+++ b/react/features/invite/components/add-people-dialog/native/InviteButton.js
@@ -8,12 +8,18 @@ import { IconAddPeople } from '../../../../base/icons';
import { connect } from '../../../../base/redux';
import { AbstractButton } from '../../../../base/toolbox';
import type { AbstractButtonProps } from '../../../../base/toolbox';
+import { beginShareRoom } from '../../../../share-room';
import { setAddPeopleDialogVisible } from '../../../actions';
import { isAddPeopleEnabled, isDialOutEnabled } from '../../../functions';
type Props = AbstractButtonProps & {
+ /**
+ * Whether the (backend) add people feature is enabled or not.
+ */
+ _addPeopleEnabled: boolean,
+
/**
* The Redux dispatch function.
*/
@@ -36,7 +42,13 @@ class InviteButton extends AbstractButton<Props, *> {
* @returns {void}
*/
_handleClick() {
- this.props.dispatch(setAddPeopleDialogVisible(true));
+ const { _addPeopleEnabled, dispatch } = this.props;
+
+ if (_addPeopleEnabled) {
+ dispatch(setAddPeopleDialogVisible(true));
+ } else {
+ dispatch(beginShareRoom());
+ }
}
}
@@ -45,18 +57,15 @@ class InviteButton extends AbstractButton<Props, *> {
* props.
*
* @param {Object} state - The redux store/state.
- * @param {Object} ownProps - The properties explicitly passed to the component
- * instance.
* @private
* @returns {Object}
*/
-function _mapStateToProps(state: Object, ownProps: Object) {
+function _mapStateToProps(state: Object) {
const addPeopleEnabled = getFeatureFlag(state, INVITE_ENABLED, true)
&& (isAddPeopleEnabled(state) || isDialOutEnabled(state));
- const { visible = Boolean(addPeopleEnabled) } = ownProps;
return {
- visible
+ _addPeopleEnabled: addPeopleEnabled
};
}
diff --git a/react/features/invite/components/info-dialog/index.native.js b/react/features/invite/components/info-dialog/index.native.js
index a32ec60612..e69de29bb2 100644
--- a/react/features/invite/components/info-dialog/index.native.js
+++ b/react/features/invite/components/info-dialog/index.native.js
@@ -1,3 +0,0 @@
-// @flow
-
-export * from './native';
diff --git a/react/features/invite/components/info-dialog/native/InfoDialogButton.js b/react/features/invite/components/info-dialog/native/InfoDialogButton.js
deleted file mode 100644
index b954c506ba..0000000000
--- a/react/features/invite/components/info-dialog/native/InfoDialogButton.js
+++ /dev/null
@@ -1,39 +0,0 @@
-// @flow
-
-import type { Dispatch } from 'redux';
-
-import { translate } from '../../../../base/i18n';
-import { IconInfo } from '../../../../base/icons';
-import { connect } from '../../../../base/redux';
-import { AbstractButton } from '../../../../base/toolbox';
-import type { AbstractButtonProps } from '../../../../base/toolbox';
-import { beginShareRoom } from '../../../../share-room';
-
-type Props = AbstractButtonProps & {
-
- /**
- * The Redux dispatch function.
- */
- dispatch: Dispatch<any>
-};
-
-/**
- * Implements an {@link AbstractButton} to open the info dialog of the meeting.
- */
-class InfoDialogButton extends AbstractButton<Props, *> {
- accessibilityLabel = 'info.accessibilityLabel';
- icon = IconInfo;
- label = 'info.label';
-
- /**
- * Handles clicking / pressing the button, and opens the appropriate dialog.
- *
- * @private
- * @returns {void}
- */
- _handleClick() {
- this.props.dispatch(beginShareRoom());
- }
-}
-
-export default translate(connect()(InfoDialogButton));
diff --git a/react/features/invite/components/info-dialog/native/index.js b/react/features/invite/components/info-dialog/native/index.js
deleted file mode 100644
index 716ff1f95d..0000000000
--- a/react/features/invite/components/info-dialog/native/index.js
+++ /dev/null
@@ -1,3 +0,0 @@
-// @flow
-
-export { default as InfoDialogButton } from './InfoDialogButton';
diff --git a/react/features/toolbox/components/native/OverflowMenu.js b/react/features/toolbox/components/native/OverflowMenu.js
index b37b511cf4..26d820253b 100644
--- a/react/features/toolbox/components/native/OverflowMenu.js
+++ b/react/features/toolbox/components/native/OverflowMenu.js
@@ -7,11 +7,11 @@ import Collapsible from 'react-native-collapsible';
import { ColorSchemeRegistry } from '../../../base/color-scheme';
import { BottomSheet, hideDialog, isDialogOpen } from '../../../base/dialog';
import { IconDragHandle } from '../../../base/icons';
-import { CHAT_ENABLED, IOS_RECORDING_ENABLED, getFeatureFlag } from '../../../base/flags';
+import { IOS_RECORDING_ENABLED, getFeatureFlag } from '../../../base/flags';
import { connect } from '../../../base/redux';
import { StyleType } from '../../../base/styles';
import { SharedDocumentButton } from '../../../etherpad';
-import { InfoDialogButton, InviteButton } from '../../../invite';
+import { InviteButton } from '../../../invite';
import { AudioRouteButton } from '../../../mobile/audio-mode';
import { LiveStreamButton, RecordButton } from '../../../recording';
import { RoomLockButton } from '../../../room-lock';
@@ -36,11 +36,6 @@ type Props = {
*/
_bottomSheetStyles: StyleType,
- /**
- * Whether the chat feature has been enabled. The meeting info button will be displayed in its place when disabled.
- */
- _chatEnabled: boolean,
-
/**
* True if the overflow menu is currently visible, false otherwise.
*/
@@ -145,10 +140,6 @@ class OverflowMenu extends PureComponent<Props, State> {
<LiveStreamButton { ...buttonProps } />
<TileViewButton { ...buttonProps } />
<InviteButton { ...buttonProps } />
- {
- this.props._chatEnabled
- && <InfoDialogButton { ...buttonProps } />
- }
<RaiseHandButton { ...buttonProps } />
<SharedDocumentButton { ...buttonProps } />
<HelpButton { ...buttonProps } />
@@ -249,7 +240,6 @@ class OverflowMenu extends PureComponent<Props, State> {
function _mapStateToProps(state) {
return {
_bottomSheetStyles: ColorSchemeRegistry.get(state, 'BottomSheet'),
- _chatEnabled: getFeatureFlag(state, CHAT_ENABLED, true),
_isOpen: isDialogOpen(state, OverflowMenu_),
_recordingEnabled: Platform.OS !== 'ios' || getFeatureFlag(state, IOS_RECORDING_ENABLED)
};
diff --git a/react/features/toolbox/components/native/Toolbox.js b/react/features/toolbox/components/native/Toolbox.js
index c3ceb9b7c0..f808ef24e5 100644
--- a/react/features/toolbox/components/native/Toolbox.js
+++ b/react/features/toolbox/components/native/Toolbox.js
@@ -9,7 +9,7 @@ import { Container } from '../../../base/react';
import { connect } from '../../../base/redux';
import { StyleType } from '../../../base/styles';
import { ChatButton } from '../../../chat';
-import { InfoDialogButton } from '../../../invite';
+import { InviteButton } from '../../../invite';
import { isToolboxVisible } from '../../functions';
@@ -122,7 +122,7 @@ class Toolbox extends PureComponent<Props> {
}
{
!_chatEnabled
- && <InfoDialogButton
+ && <InviteButton
styles = { buttonStyles }
toggledStyles = { toggledButtonStyles } />
}