Pārlūkot izejas kodu

fix(rn,lobby) use a header for the main lobby screen

It allows us to place the Cancel button there, and declutter the UI of
buttons.
master
Saúl Ibarra Corretgé 3 gadus atpakaļ
vecāks
revīzija
1c79e6baa3

+ 21
- 10
react/features/lobby/components/native/LobbyScreen.js Parādīt failu

@@ -12,6 +12,8 @@ import BaseTheme from '../../../base/ui/components/BaseTheme';
12 12
 import InviteButton
13 13
     from '../../../invite/components/add-people-dialog/native/InviteButton';
14 14
 import { LargeVideo } from '../../../large-video/components';
15
+import HeaderNavigationButton
16
+    from '../../../mobile/navigation/components/HeaderNavigationButton';
15 17
 import { navigate }
16 18
     from '../../../mobile/navigation/components/lobby/LobbyNavigationContainerRef';
17 19
 import { screen } from '../../../mobile/navigation/routes';
@@ -36,6 +38,25 @@ type Props = AbstractProps & {
36 38
  * Implements a waiting screen that represents the participant being in the lobby.
37 39
  */
38 40
 class LobbyScreen extends AbstractLobbyScreen<Props> {
41
+    /**
42
+     * Implements React's {@link Component#componentDidMount()}. Invoked
43
+     * immediately after this component is mounted.
44
+     *
45
+     * @inheritdoc
46
+     * @returns {void}
47
+     */
48
+    componentDidMount() {
49
+        const { navigation, t } = this.props;
50
+
51
+        navigation.setOptions({
52
+            headerLeft: () => (
53
+                <HeaderNavigationButton
54
+                    label = { t('dialog.Cancel') }
55
+                    onPress = { this._onCancel } />
56
+            )
57
+        });
58
+    }
59
+
39 60
     /**
40 61
      * Implements {@code PureComponent#render}.
41 62
      *
@@ -292,16 +313,6 @@ class LobbyScreen extends AbstractLobbyScreen<Props> {
292 313
                         { t('lobby.enterPasswordButton') }
293 314
                     </Text>
294 315
                 </TouchableOpacity> }
295
-                <TouchableOpacity
296
-                    onPress = { this._onCancel }
297
-                    style = { [
298
-                        styles.button,
299
-                        styles.cancelButton
300
-                    ] }>
301
-                    <Text style = { styles.cancelButtonText }>
302
-                        { t('dialog.Cancel') }
303
-                    </Text>
304
-                </TouchableOpacity>
305 316
             </View>
306 317
         );
307 318
     }

+ 1
- 13
react/features/lobby/components/native/styles.js Parādīt failu

@@ -71,7 +71,7 @@ export default {
71 71
         alignItems: 'center',
72 72
         display: 'flex',
73 73
         justifyContent: 'center',
74
-        minHeight: '45%'
74
+        minHeight: '50%'
75 75
     },
76 76
 
77 77
     largeVideoContainerWide: {
@@ -214,18 +214,6 @@ export default {
214 214
         textAlign: 'center'
215 215
     },
216 216
 
217
-    cancelButton: {
218
-        alignItems: 'center',
219
-        backgroundColor: BaseTheme.palette.action02Disabled,
220
-        marginTop: BaseTheme.spacing[4]
221
-    },
222
-
223
-    cancelButtonText: {
224
-        ...BaseTheme.typography.labelButtonLarge,
225
-        color: BaseTheme.palette.text01,
226
-        lineHeight: 30
227
-    },
228
-
229 217
     // KnockingParticipantList
230 218
 
231 219
     knockingParticipantList: {

+ 2
- 1
react/features/mobile/navigation/components/lobby/components/LobbyNavigationContainer.js Parādīt failu

@@ -7,7 +7,8 @@ import { LobbyChatScreen, LobbyScreen } from '../../../../../lobby';
7 7
 import { screen } from '../../../routes';
8 8
 import {
9 9
     lobbyChatScreenOptions,
10
-    lobbyScreenOptions, navigationContainerTheme
10
+    lobbyScreenOptions,
11
+    navigationContainerTheme
11 12
 } from '../../../screenOptions';
12 13
 import { lobbyNavigationContainerRef } from '../LobbyNavigationContainerRef';
13 14
 

+ 5
- 5
react/features/mobile/navigation/screenOptions.js Parādīt failu

@@ -168,11 +168,6 @@ export const helpScreenOptions = {
168 168
  */
169 169
 export const conferenceScreenOptions = fullScreenOptions;
170 170
 
171
-/**
172
- * Screen options for lobby modal.
173
- */
174
-export const lobbyScreenOptions = fullScreenOptions;
175
-
176 171
 /**
177 172
  * Tab bar options for chat screen.
178 173
  */
@@ -238,6 +233,11 @@ export const recordingScreenOptions = presentationScreenOptions;
238 233
  */
239 234
 export const liveStreamScreenOptions = presentationScreenOptions;
240 235
 
236
+/**
237
+ * Screen options for lobby modal.
238
+ */
239
+export const lobbyScreenOptions = presentationScreenOptions;
240
+
241 241
 /**
242 242
  * Screen options for lobby chat modal.
243 243
  */

Notiek ielāde…
Atcelt
Saglabāt