Quellcode durchsuchen

[RN] Add InfoDialogButton

master
Bettenbuk Zoltan vor 6 Jahren
Ursprung
Commit
4d9dcf5d43

+ 0
- 0
react/features/invite/components/InfoDialogButton.native.js Datei anzeigen


+ 0
- 118
react/features/invite/components/InviteButton.native.js Datei anzeigen

@@ -1,118 +0,0 @@
1
-// @flow
2
-
3
-import type { Dispatch } from 'redux';
4
-
5
-import { translate } from '../../base/i18n';
6
-import { connect } from '../../base/redux';
7
-import { AbstractButton } from '../../base/toolbox';
8
-import type { AbstractButtonProps } from '../../base/toolbox';
9
-import { beginShareRoom } from '../../share-room';
10
-
11
-import { setAddPeopleDialogVisible } from '../actions';
12
-import { isAddPeopleEnabled, isDialOutEnabled } from '../functions';
13
-
14
-type Props = AbstractButtonProps & {
15
-
16
-    /**
17
-     * Whether or not the feature to invite people to join the
18
-     * conference is available.
19
-     */
20
-    _addPeopleEnabled: boolean,
21
-
22
-    /**
23
-     * Opens the add people dialog.
24
-     */
25
-    _onOpenAddPeopleDialog: Function,
26
-
27
-    /**
28
-     * Begins the UI procedure to share the conference/room URL.
29
-     */
30
-    _onShareRoom: Function
31
-};
32
-
33
-/**
34
- * Implements an {@link AbstractButton} to enter add/invite people to the
35
- * current call/conference/meeting.
36
- */
37
-class InviteButton extends AbstractButton<Props, *> {
38
-    accessibilityLabel = 'toolbar.accessibilityLabel.shareRoom';
39
-    iconName = 'icon-link';
40
-    label = 'toolbar.shareRoom';
41
-
42
-    /**
43
-     * Handles clicking / pressing the button, and opens the appropriate dialog.
44
-     *
45
-     * @private
46
-     * @returns {void}
47
-     */
48
-    _handleClick() {
49
-        const {
50
-            _addPeopleEnabled,
51
-            _onOpenAddPeopleDialog,
52
-            _onShareRoom
53
-        } = this.props;
54
-
55
-        if (_addPeopleEnabled) {
56
-            _onOpenAddPeopleDialog();
57
-        } else {
58
-            _onShareRoom();
59
-        }
60
-    }
61
-}
62
-
63
-/**
64
- * Maps redux actions to {@link InviteButton}'s React
65
- * {@code Component} props.
66
- *
67
- * @param {Function} dispatch - The redux action {@code dispatch} function.
68
- * @returns {{
69
- *     _onOpenAddPeopleDialog,
70
- *     _onShareRoom
71
- * }}
72
- * @private
73
- */
74
-function _mapDispatchToProps(dispatch: Dispatch<any>) {
75
-    return {
76
-
77
-        /**
78
-         * Opens the add people dialog.
79
-         *
80
-         * @private
81
-         * @returns {void}
82
-         * @type {Function}
83
-         */
84
-        _onOpenAddPeopleDialog() {
85
-            dispatch(setAddPeopleDialogVisible(true));
86
-        },
87
-
88
-        /**
89
-         * Begins the UI procedure to share the conference/room URL.
90
-         *
91
-         * @private
92
-         * @returns {void}
93
-         * @type {Function}
94
-         */
95
-        _onShareRoom() {
96
-            dispatch(beginShareRoom());
97
-        }
98
-    };
99
-}
100
-
101
-/**
102
- * Maps (parts of) the redux state to {@link Toolbox}'s React {@code Component}
103
- * props.
104
- *
105
- * @param {Object} state - The redux store/state.
106
- * @private
107
- * @returns {{
108
- *   _addPeopleEnabled: boolean
109
- * }}
110
- */
111
-function _mapStateToProps(state) {
112
-    return {
113
-        _addPeopleEnabled: isAddPeopleEnabled(state) || isDialOutEnabled(state)
114
-    };
115
-}
116
-
117
-export default translate(
118
-    connect(_mapStateToProps, _mapDispatchToProps)(InviteButton));

+ 0
- 0
react/features/invite/components/InviteButton.web.js Datei anzeigen


+ 73
- 0
react/features/invite/components/add-people-dialog/native/InviteButton.js Datei anzeigen

@@ -0,0 +1,73 @@
1
+// @flow
2
+
3
+import type { Dispatch } from 'redux';
4
+
5
+import { translate } from '../../../../base/i18n';
6
+import { connect } from '../../../../base/redux';
7
+import { AbstractButton } from '../../../../base/toolbox';
8
+import type { AbstractButtonProps } from '../../../../base/toolbox';
9
+
10
+import { setAddPeopleDialogVisible } from '../../../actions';
11
+import { isAddPeopleEnabled, isDialOutEnabled } from '../../../functions';
12
+
13
+type Props = AbstractButtonProps & {
14
+
15
+    /**
16
+     * Whether or not the feature to invite people to join the
17
+     * conference is available.
18
+     */
19
+    _addPeopleEnabled: boolean,
20
+
21
+    /**
22
+     * The Redux dispatch function.
23
+     */
24
+    dispatch: Dispatch<any>
25
+};
26
+
27
+/**
28
+ * Implements an {@link AbstractButton} to enter add/invite people to the
29
+ * current call/conference/meeting.
30
+ */
31
+class InviteButton extends AbstractButton<Props, *> {
32
+    accessibilityLabel = 'toolbar.accessibilityLabel.shareRoom';
33
+    iconName = 'icon-link';
34
+    label = 'toolbar.shareRoom';
35
+
36
+    /**
37
+     * Handles clicking / pressing the button, and opens the appropriate dialog.
38
+     *
39
+     * @private
40
+     * @returns {void}
41
+     */
42
+    _handleClick() {
43
+        this.props.dispatch(setAddPeopleDialogVisible(true));
44
+    }
45
+
46
+    /**
47
+     * Returns true if none of the invite methods are available.
48
+     *
49
+     * @protected
50
+     * @returns {boolean}
51
+     */
52
+    _isDisabled() {
53
+        return !this.props._addPeopleEnabled;
54
+    }
55
+}
56
+
57
+/**
58
+ * Maps (parts of) the redux state to {@link InviteButton}'s React {@code Component}
59
+ * props.
60
+ *
61
+ * @param {Object} state - The redux store/state.
62
+ * @private
63
+ * @returns {{
64
+ *   _addPeopleEnabled: boolean
65
+ * }}
66
+ */
67
+function _mapStateToProps(state) {
68
+    return {
69
+        _addPeopleEnabled: isAddPeopleEnabled(state) || isDialOutEnabled(state)
70
+    };
71
+}
72
+
73
+export default translate(connect(_mapStateToProps)(InviteButton));

+ 1
- 0
react/features/invite/components/add-people-dialog/native/index.js Datei anzeigen

@@ -1,3 +1,4 @@
1 1
 // @flow
2 2
 
3 3
 export { default as AddPeopleDialog } from './AddPeopleDialog';
4
+export { default as InviteButton } from './InviteButton';

+ 1
- 2
react/features/invite/components/index.js Datei anzeigen

@@ -2,6 +2,5 @@
2 2
 
3 3
 export * from './add-people-dialog';
4 4
 export { DialInSummary } from './dial-in-summary';
5
-export { default as InfoDialogButton } from './InfoDialogButton';
6
-export { default as InviteButton } from './InviteButton';
5
+export * from './info-dialog';
7 6
 export * from './callee-info';

+ 0
- 0
react/features/invite/components/info-dialog/DialInNumber.native.js Datei anzeigen


+ 0
- 0
react/features/invite/components/info-dialog/InfoDialog.native.js Datei anzeigen


+ 0
- 0
react/features/invite/components/info-dialog/PasswordForm.native.js Datei anzeigen


+ 0
- 1
react/features/invite/components/info-dialog/index.js Datei anzeigen

@@ -1 +0,0 @@
1
-export { default as InfoDialog } from './InfoDialog';

+ 3
- 0
react/features/invite/components/info-dialog/index.native.js Datei anzeigen

@@ -0,0 +1,3 @@
1
+// @flow
2
+
3
+export * from './native';

+ 3
- 0
react/features/invite/components/info-dialog/index.web.js Datei anzeigen

@@ -0,0 +1,3 @@
1
+// @flow
2
+
3
+export * from './web';

+ 38
- 0
react/features/invite/components/info-dialog/native/InfoDialogButton.js Datei anzeigen

@@ -0,0 +1,38 @@
1
+// @flow
2
+
3
+import type { Dispatch } from 'redux';
4
+
5
+import { translate } from '../../../../base/i18n';
6
+import { connect } from '../../../../base/redux';
7
+import { AbstractButton } from '../../../../base/toolbox';
8
+import type { AbstractButtonProps } from '../../../../base/toolbox';
9
+import { beginShareRoom } from '../../../../share-room';
10
+
11
+type Props = AbstractButtonProps & {
12
+
13
+    /**
14
+     * The Redux dispatch function.
15
+     */
16
+    dispatch: Dispatch<any>
17
+};
18
+
19
+/**
20
+ * Implements an {@link AbstractButton} to open the info dialog of the meeting.
21
+ */
22
+class InfoDialogButton extends AbstractButton<Props, *> {
23
+    accessibilityLabel = 'info.accessibilityLabel';
24
+    iconName = 'icon-info';
25
+    label = 'info.label';
26
+
27
+    /**
28
+     * Handles clicking / pressing the button, and opens the appropriate dialog.
29
+     *
30
+     * @private
31
+     * @returns {void}
32
+     */
33
+    _handleClick() {
34
+        this.props.dispatch(beginShareRoom());
35
+    }
36
+}
37
+
38
+export default translate(connect()(InfoDialogButton));

+ 3
- 0
react/features/invite/components/info-dialog/native/index.js Datei anzeigen

@@ -0,0 +1,3 @@
1
+// @flow
2
+
3
+export { default as InfoDialogButton } from './InfoDialogButton';

react/features/invite/components/info-dialog/DialInNumber.web.js → react/features/invite/components/info-dialog/web/DialInNumber.js Datei anzeigen

@@ -1,8 +1,8 @@
1
-/* @flow */
1
+// @flow
2 2
 
3 3
 import React, { Component } from 'react';
4 4
 
5
-import { translate } from '../../../base/i18n';
5
+import { translate } from '../../../../base/i18n';
6 6
 
7 7
 /**
8 8
  * The type of the React {@code Component} props of {@link DialInNumber}.

react/features/invite/components/info-dialog/InfoDialog.web.js → react/features/invite/components/info-dialog/web/InfoDialog.js Datei anzeigen

@@ -1,16 +1,16 @@
1
-/* @flow */
1
+// @flow
2 2
 
3 3
 import React, { Component } from 'react';
4 4
 import type { Dispatch } from 'redux';
5 5
 
6
-import { setPassword } from '../../../base/conference';
7
-import { getInviteURL } from '../../../base/connection';
8
-import { Dialog } from '../../../base/dialog';
9
-import { translate } from '../../../base/i18n';
10
-import { connect } from '../../../base/redux';
11
-import { isLocalParticipantModerator } from '../../../base/participants';
6
+import { setPassword } from '../../../../base/conference';
7
+import { getInviteURL } from '../../../../base/connection';
8
+import { Dialog } from '../../../../base/dialog';
9
+import { translate } from '../../../../base/i18n';
10
+import { connect } from '../../../../base/redux';
11
+import { isLocalParticipantModerator } from '../../../../base/participants';
12 12
 
13
-import { _getDefaultPhoneNumber, getDialInfoPageURL } from '../../functions';
13
+import { _getDefaultPhoneNumber, getDialInfoPageURL } from '../../../functions';
14 14
 import DialInNumber from './DialInNumber';
15 15
 import PasswordForm from './PasswordForm';
16 16
 

react/features/invite/components/InfoDialogButton.web.js → react/features/invite/components/info-dialog/web/InfoDialogButton.js Datei anzeigen

@@ -4,18 +4,18 @@ import InlineDialog from '@atlaskit/inline-dialog';
4 4
 import React, { Component } from 'react';
5 5
 import type { Dispatch } from 'redux';
6 6
 
7
-import { createToolbarEvent, sendAnalytics } from '../../analytics';
8
-import { openDialog } from '../../base/dialog';
9
-import { translate } from '../../base/i18n';
10
-import { JitsiRecordingConstants } from '../../base/lib-jitsi-meet';
11
-import { getParticipantCount } from '../../base/participants';
12
-import { OverflowMenuItem } from '../../base/toolbox';
13
-import { connect } from '../../base/redux';
14
-import { getActiveSession } from '../../recording';
15
-import { ToolbarButton } from '../../toolbox';
16
-import { updateDialInNumbers } from '../actions';
17
-
18
-import { InfoDialog } from './info-dialog';
7
+import { createToolbarEvent, sendAnalytics } from '../../../../analytics';
8
+import { openDialog } from '../../../../base/dialog';
9
+import { translate } from '../../../../base/i18n';
10
+import { JitsiRecordingConstants } from '../../../../base/lib-jitsi-meet';
11
+import { getParticipantCount } from '../../../../base/participants';
12
+import { OverflowMenuItem } from '../../../../base/toolbox';
13
+import { connect } from '../../../../base/redux';
14
+import { getActiveSession } from '../../../../recording';
15
+import { ToolbarButton } from '../../../../toolbox';
16
+import { updateDialInNumbers } from '../../../actions';
17
+
18
+import InfoDialog from './InfoDialog';
19 19
 
20 20
 /**
21 21
  * The type of the React {@code Component} props of {@link InfoDialogButton}.

react/features/invite/components/info-dialog/PasswordForm.web.js → react/features/invite/components/info-dialog/web/PasswordForm.js Datei anzeigen

@@ -1,9 +1,9 @@
1
-/* @flow */
1
+// @flow
2 2
 
3 3
 import React, { Component } from 'react';
4 4
 
5
-import { translate } from '../../../base/i18n';
6
-import { LOCKED_LOCALLY } from '../../../room-lock';
5
+import { translate } from '../../../../base/i18n';
6
+import { LOCKED_LOCALLY } from '../../../../room-lock';
7 7
 
8 8
 /**
9 9
  * The type of the React {@code Component} props of {@link PasswordForm}.

+ 4
- 0
react/features/invite/components/info-dialog/web/index.js Datei anzeigen

@@ -0,0 +1,4 @@
1
+// @flow
2
+
3
+export { default as InfoDialog } from './InfoDialog';
4
+export { default as InfoDialogButton } from './InfoDialogButton';

+ 2
- 1
react/features/toolbox/components/native/OverflowMenu.js Datei anzeigen

@@ -10,7 +10,7 @@ import {
10 10
 } from '../../../base/dialog';
11 11
 import { connect } from '../../../base/redux';
12 12
 import { StyleType } from '../../../base/styles';
13
-import { InviteButton } from '../../../invite';
13
+import { InfoDialogButton, InviteButton } from '../../../invite';
14 14
 import { AudioRouteButton } from '../../../mobile/audio-mode';
15 15
 import { LiveStreamButton, RecordButton } from '../../../recording';
16 16
 import { RoomLockButton } from '../../../room-lock';
@@ -96,6 +96,7 @@ class OverflowMenu extends Component<Props> {
96 96
                 <LiveStreamButton { ...buttonProps } />
97 97
                 <TileViewButton { ...buttonProps } />
98 98
                 <InviteButton { ...buttonProps } />
99
+                <InfoDialogButton { ...buttonProps } />
99 100
                 <RaiseHandButton { ...buttonProps } />
100 101
             </BottomSheet>
101 102
         );

Laden…
Abbrechen
Speichern