Bläddra i källkod

rn,overflow-menu: add a "more options" button

master
Saúl Ibarra Corretgé 5 år sedan
förälder
incheckning
a4333d3a80

+ 2
- 0
lang/main.json Visa fil

@@ -590,6 +590,7 @@
590 590
             "lockRoom": "Toggle meeting password",
591 591
             "moreActions": "Toggle more actions menu",
592 592
             "moreActionsMenu": "More actions menu",
593
+            "moreOptions": "Show more options",
593 594
             "mute": "Toggle mute audio",
594 595
             "pip": "Toggle Picture-in-Picture mode",
595 596
             "privateMessage": "Send private message",
@@ -632,6 +633,7 @@
632 633
         "logout": "Logout",
633 634
         "lowerYourHand": "Lower your hand",
634 635
         "moreActions": "More actions",
636
+        "moreOptions": "More options",
635 637
         "mute": "Mute / Unmute",
636 638
         "noAudioSignalTitle": "There is no input coming from your mic!",
637 639
         "noAudioSignalDesc": "If you did not purposely mute it from system settings or hardware, consider switching the device.",

+ 2
- 8
react/features/base/dialog/components/native/BottomSheet.js Visa fil

@@ -44,12 +44,7 @@ type Props = {
44 44
     /**
45 45
      * Callback to be attached to the custom swipe event of the BottomSheet.
46 46
      */
47
-    onSwipe?: Function,
48
-
49
-    /**
50
-     * Function to render a bottom sheet header element, if necessary.
51
-     */
52
-    renderHeader: ?Function
47
+    onSwipe?: Function
53 48
 };
54 49
 
55 50
 /**
@@ -80,7 +75,7 @@ class BottomSheet extends PureComponent<Props> {
80 75
      * @returns {ReactElement}
81 76
      */
82 77
     render() {
83
-        const { _styles, renderHeader } = this.props;
78
+        const { _styles } = this.props;
84 79
 
85 80
         return (
86 81
             <SlidingView
@@ -93,7 +88,6 @@ class BottomSheet extends PureComponent<Props> {
93 88
                     <View
94 89
                         pointerEvents = 'box-none'
95 90
                         style = { styles.sheetAreaCover } />
96
-                    { renderHeader && renderHeader() }
97 91
                     <SafeAreaView
98 92
                         style = { [
99 93
                             styles.sheetItemContainer,

+ 0
- 6
react/features/base/dialog/components/native/styles.js Visa fil

@@ -172,12 +172,6 @@ ColorSchemeRegistry.register('BottomSheet', {
172 172
         underlayColor: ColorPalette.overflowMenuItemUnderlay
173 173
     },
174 174
 
175
-    expandIcon: {
176
-        color: schemeColor('icon'),
177
-        fontSize: 16,
178
-        opacity: 0.7
179
-    },
180
-
181 175
     /**
182 176
      * Bottom sheet's base style.
183 177
      */

+ 0
- 1
react/features/base/icons/svg/drag-handle.svg Visa fil

@@ -1 +0,0 @@
1
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24" viewBox="0 0 24 24"><defs><path id="a" d="M0 0h24v24H0V0z"/></defs><clipPath id="b"><use xlink:href="#a" overflow="visible"/></clipPath><path clip-path="url(#b)" d="M20 9H4v2h16V9zM4 15h16v-2H4v2z"/></svg>

+ 0
- 1
react/features/base/icons/svg/index.js Visa fil

@@ -25,7 +25,6 @@ export { default as IconDeviceHeadphone } from './headset.svg';
25 25
 export { default as IconDeviceSpeaker } from './volume.svg';
26 26
 export { default as IconDominantSpeaker } from './dominant-speaker.svg';
27 27
 export { default as IconDownload } from './download.svg';
28
-export { default as IconDragHandle } from './drag-handle.svg';
29 28
 export { default as IconEventNote } from './event_note.svg';
30 29
 export { default as IconExitFullScreen } from './exit-full-screen.svg';
31 30
 export { default as IconFeedback } from './feedback.svg';

+ 21
- 0
react/features/toolbox/components/native/MoreOptionsButton.js Visa fil

@@ -0,0 +1,21 @@
1
+// @flow
2
+
3
+import { translate } from '../../../base/i18n';
4
+import { IconMenu } from '../../../base/icons';
5
+import { AbstractButton } from '../../../base/toolbox';
6
+import type { AbstractButtonProps } from '../../../base/toolbox';
7
+
8
+
9
+type Props = AbstractButtonProps;
10
+
11
+/**
12
+ * An implementation of a button to show more menu options.
13
+ */
14
+class MoreOptionsButton extends AbstractButton<Props, any> {
15
+    accessibilityLabel = 'toolbar.accessibilityLabel.moreOptions';
16
+    icon = IconMenu;
17
+    label = 'toolbar.moreOptions';
18
+}
19
+
20
+
21
+export default translate(MoreOptionsButton);

+ 11
- 30
react/features/toolbox/components/native/OverflowMenu.js Visa fil

@@ -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)

+ 0
- 10
react/features/toolbox/components/native/styles.js Visa fil

@@ -55,16 +55,6 @@ const whiteToolbarButtonIcon = {
55 55
  */
56 56
 const styles = {
57 57
 
58
-    expandMenuContainer: {
59
-        alignItems: 'center',
60
-        flexDirection: 'column'
61
-    },
62
-
63
-    sheetGestureRecognizer: {
64
-        alignItems: 'stretch',
65
-        flexDirection: 'column'
66
-    },
67
-
68 58
     /**
69 59
      * The style of the toolbar.
70 60
      */

Laddar…
Avbryt
Spara