소스 검색

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 년 전
부모
커밋
1c79e6baa3

+ 21
- 10
react/features/lobby/components/native/LobbyScreen.js 파일 보기

12
 import InviteButton
12
 import InviteButton
13
     from '../../../invite/components/add-people-dialog/native/InviteButton';
13
     from '../../../invite/components/add-people-dialog/native/InviteButton';
14
 import { LargeVideo } from '../../../large-video/components';
14
 import { LargeVideo } from '../../../large-video/components';
15
+import HeaderNavigationButton
16
+    from '../../../mobile/navigation/components/HeaderNavigationButton';
15
 import { navigate }
17
 import { navigate }
16
     from '../../../mobile/navigation/components/lobby/LobbyNavigationContainerRef';
18
     from '../../../mobile/navigation/components/lobby/LobbyNavigationContainerRef';
17
 import { screen } from '../../../mobile/navigation/routes';
19
 import { screen } from '../../../mobile/navigation/routes';
36
  * Implements a waiting screen that represents the participant being in the lobby.
38
  * Implements a waiting screen that represents the participant being in the lobby.
37
  */
39
  */
38
 class LobbyScreen extends AbstractLobbyScreen<Props> {
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
      * Implements {@code PureComponent#render}.
61
      * Implements {@code PureComponent#render}.
41
      *
62
      *
292
                         { t('lobby.enterPasswordButton') }
313
                         { t('lobby.enterPasswordButton') }
293
                     </Text>
314
                     </Text>
294
                 </TouchableOpacity> }
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
             </View>
316
             </View>
306
         );
317
         );
307
     }
318
     }

+ 1
- 13
react/features/lobby/components/native/styles.js 파일 보기

71
         alignItems: 'center',
71
         alignItems: 'center',
72
         display: 'flex',
72
         display: 'flex',
73
         justifyContent: 'center',
73
         justifyContent: 'center',
74
-        minHeight: '45%'
74
+        minHeight: '50%'
75
     },
75
     },
76
 
76
 
77
     largeVideoContainerWide: {
77
     largeVideoContainerWide: {
214
         textAlign: 'center'
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
     // KnockingParticipantList
217
     // KnockingParticipantList
230
 
218
 
231
     knockingParticipantList: {
219
     knockingParticipantList: {

+ 2
- 1
react/features/mobile/navigation/components/lobby/components/LobbyNavigationContainer.js 파일 보기

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

+ 5
- 5
react/features/mobile/navigation/screenOptions.js 파일 보기

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

Loading…
취소
저장