|
@@ -1,12 +1,11 @@
|
1
|
1
|
// @flow
|
2
|
2
|
|
3
|
3
|
import React, { PureComponent } from 'react';
|
4
|
|
-import { Platform, TouchableOpacity, View } from 'react-native';
|
|
4
|
+import { Platform } from 'react-native';
|
5
|
5
|
import Collapsible from 'react-native-collapsible';
|
6
|
6
|
|
7
|
7
|
import { ColorSchemeRegistry } from '../../../base/color-scheme';
|
8
|
8
|
import { BottomSheet, hideDialog, isDialogOpen } from '../../../base/dialog';
|
9
|
|
-import { IconDragHandle } from '../../../base/icons';
|
10
|
9
|
import { CHAT_ENABLED, IOS_RECORDING_ENABLED, getFeatureFlag } from '../../../base/flags';
|
11
|
10
|
import { connect } from '../../../base/redux';
|
12
|
11
|
import { StyleType } from '../../../base/styles';
|
|
@@ -21,9 +20,9 @@ import { TileViewButton } from '../../../video-layout';
|
21
|
20
|
import HelpButton from '../HelpButton';
|
22
|
21
|
|
23
|
22
|
import AudioOnlyButton from './AudioOnlyButton';
|
|
23
|
+import MoreOptionsButton from './MoreOptionsButton';
|
24
|
24
|
import RaiseHandButton from './RaiseHandButton';
|
25
|
25
|
import ToggleCameraButton from './ToggleCameraButton';
|
26
|
|
-import styles from './styles';
|
27
|
26
|
|
28
|
27
|
/**
|
29
|
28
|
* The type of the React {@code Component} props of {@link OverflowMenu}.
|
|
@@ -100,7 +99,6 @@ class OverflowMenu extends PureComponent<Props, State> {
|
100
|
99
|
this._onCancel = this._onCancel.bind(this);
|
101
|
100
|
this._onSwipe = this._onSwipe.bind(this);
|
102
|
101
|
this._onToggleMenu = this._onToggleMenu.bind(this);
|
103
|
|
- this._renderMenuExpandToggle = this._renderMenuExpandToggle.bind(this);
|
104
|
102
|
}
|
105
|
103
|
|
106
|
104
|
/**
|
|
@@ -119,14 +117,20 @@ class OverflowMenu extends PureComponent<Props, State> {
|
119
|
117
|
styles: _bottomSheetStyles.buttons
|
120
|
118
|
};
|
121
|
119
|
|
|
120
|
+ const moreOptionsButtonProps = {
|
|
121
|
+ ...buttonProps,
|
|
122
|
+ afterClick: this._onToggleMenu,
|
|
123
|
+ visible: !showMore
|
|
124
|
+ };
|
|
125
|
+
|
122
|
126
|
return (
|
123
|
127
|
<BottomSheet
|
124
|
128
|
onCancel = { this._onCancel }
|
125
|
|
- onSwipe = { this._onSwipe }
|
126
|
|
- renderHeader = { this._renderMenuExpandToggle }>
|
|
129
|
+ onSwipe = { this._onSwipe }>
|
127
|
130
|
<AudioRouteButton { ...buttonProps } />
|
128
|
131
|
<ToggleCameraButton { ...buttonProps } />
|
129
|
132
|
<AudioOnlyButton { ...buttonProps } />
|
|
133
|
+ <MoreOptionsButton { ...moreOptionsButtonProps } />
|
130
|
134
|
<Collapsible collapsed = { !showMore }>
|
131
|
135
|
<RoomLockButton { ...buttonProps } />
|
132
|
136
|
<ClosedCaptionButton { ...buttonProps } />
|
|
@@ -149,28 +153,6 @@ class OverflowMenu extends PureComponent<Props, State> {
|
149
|
153
|
);
|
150
|
154
|
}
|
151
|
155
|
|
152
|
|
- _renderMenuExpandToggle: () => React$Element<any>;
|
153
|
|
-
|
154
|
|
- /**
|
155
|
|
- * Function to render the menu toggle in the bottom sheet header area.
|
156
|
|
- *
|
157
|
|
- * @returns {React$Element}
|
158
|
|
- */
|
159
|
|
- _renderMenuExpandToggle() {
|
160
|
|
- return (
|
161
|
|
- <View
|
162
|
|
- style = { [
|
163
|
|
- this.props._bottomSheetStyles.sheet,
|
164
|
|
- styles.expandMenuContainer
|
165
|
|
- ] }>
|
166
|
|
- <TouchableOpacity onPress = { this._onToggleMenu }>
|
167
|
|
- { /* $FlowFixMeProps */ }
|
168
|
|
- <IconDragHandle style = { this.props._bottomSheetStyles.expandIcon } />
|
169
|
|
- </TouchableOpacity>
|
170
|
|
- </View>
|
171
|
|
- );
|
172
|
|
- }
|
173
|
|
-
|
174
|
156
|
_onCancel: () => boolean;
|
175
|
157
|
|
176
|
158
|
/**
|
|
@@ -240,8 +222,7 @@ class OverflowMenu extends PureComponent<Props, State> {
|
240
|
222
|
*/
|
241
|
223
|
function _mapStateToProps(state) {
|
242
|
224
|
return {
|
243
|
|
- _bottomSheetStyles:
|
244
|
|
- ColorSchemeRegistry.get(state, 'BottomSheet'),
|
|
225
|
+ _bottomSheetStyles: ColorSchemeRegistry.get(state, 'BottomSheet'),
|
245
|
226
|
_chatEnabled: getFeatureFlag(state, CHAT_ENABLED, true),
|
246
|
227
|
_isOpen: isDialogOpen(state, OverflowMenu_),
|
247
|
228
|
_recordingEnabled: Platform.OS !== 'ios' || getFeatureFlag(state, IOS_RECORDING_ENABLED)
|