浏览代码

feat(mobile/navigation) - removed stack dependency and updated animation options

master
Calin Chitu 3 年前
父节点
当前提交
79e648867d

+ 0
- 29
package-lock.json 查看文件

@@ -50,7 +50,6 @@
50 50
         "@react-navigation/material-top-tabs": "6.0.6",
51 51
         "@react-navigation/native": "6.0.6",
52 52
         "@react-navigation/native-stack": "6.6.2",
53
-        "@react-navigation/stack": "6.0.11",
54 53
         "@svgr/webpack": "4.3.2",
55 54
         "@tensorflow/tfjs-backend-wasm": "3.13.0",
56 55
         "@tensorflow/tfjs-core": "3.13.0",
@@ -5057,24 +5056,6 @@
5057 5056
         "nanoid": "^3.1.23"
5058 5057
       }
5059 5058
     },
5060
-    "node_modules/@react-navigation/stack": {
5061
-      "version": "6.0.11",
5062
-      "resolved": "https://registry.npmjs.org/@react-navigation/stack/-/stack-6.0.11.tgz",
5063
-      "integrity": "sha512-Osc2mXi0Zh/u92HRCceDqVfVnypTa2sZgYMJDU+vDhHz38negtbCG+cjje6nApSjwC5WTVhYP4OoD5WBSh51+g==",
5064
-      "dependencies": {
5065
-        "@react-navigation/elements": "^1.2.1",
5066
-        "color": "^3.1.3",
5067
-        "warn-once": "^0.1.0"
5068
-      },
5069
-      "peerDependencies": {
5070
-        "@react-navigation/native": "^6.0.0",
5071
-        "react": "*",
5072
-        "react-native": "*",
5073
-        "react-native-gesture-handler": ">= 1.0.0",
5074
-        "react-native-safe-area-context": ">= 3.0.0",
5075
-        "react-native-screens": ">= 3.0.0"
5076
-      }
5077
-    },
5078 5059
     "node_modules/@sideway/address": {
5079 5060
       "version": "4.1.4",
5080 5061
       "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.4.tgz",
@@ -23765,16 +23746,6 @@
23765 23746
         "nanoid": "^3.1.23"
23766 23747
       }
23767 23748
     },
23768
-    "@react-navigation/stack": {
23769
-      "version": "6.0.11",
23770
-      "resolved": "https://registry.npmjs.org/@react-navigation/stack/-/stack-6.0.11.tgz",
23771
-      "integrity": "sha512-Osc2mXi0Zh/u92HRCceDqVfVnypTa2sZgYMJDU+vDhHz38negtbCG+cjje6nApSjwC5WTVhYP4OoD5WBSh51+g==",
23772
-      "requires": {
23773
-        "@react-navigation/elements": "^1.2.1",
23774
-        "color": "^3.1.3",
23775
-        "warn-once": "^0.1.0"
23776
-      }
23777
-    },
23778 23749
     "@sideway/address": {
23779 23750
       "version": "4.1.4",
23780 23751
       "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.4.tgz",

+ 0
- 1
package.json 查看文件

@@ -55,7 +55,6 @@
55 55
     "@react-navigation/material-top-tabs": "6.0.6",
56 56
     "@react-navigation/native": "6.0.6",
57 57
     "@react-navigation/native-stack": "6.6.2",
58
-    "@react-navigation/stack": "6.0.11",
59 58
     "@svgr/webpack": "4.3.2",
60 59
     "@tensorflow/tfjs-backend-wasm": "3.13.0",
61 60
     "@tensorflow/tfjs-core": "3.13.0",

+ 2
- 8
react/features/conference/components/native/styles.js 查看文件

@@ -36,10 +36,6 @@ export default {
36 36
         margin: 10
37 37
     },
38 38
 
39
-    headerNavigationIcon: {
40
-        marginLeft: 14
41
-    },
42
-
43 39
     headerNavigationButton: {
44 40
         height: BaseTheme.spacing[6],
45 41
         marginTop: 20,
@@ -48,15 +44,13 @@ export default {
48 44
 
49 45
     headerNavigationText: {
50 46
         color: BaseTheme.palette.text01,
51
-        fontSize: HEADER_ACTION_BUTTON_SIZE,
52
-        marginHorizontal: BaseTheme.spacing[3]
47
+        fontSize: HEADER_ACTION_BUTTON_SIZE
53 48
     },
54 49
 
55 50
     headerNavigationTextBold: {
56 51
         ...BaseTheme.typography.labelButton,
57 52
         color: BaseTheme.palette.text01,
58
-        fontSize: HEADER_ACTION_BUTTON_SIZE,
59
-        marginHorizontal: BaseTheme.spacing[3]
53
+        fontSize: HEADER_ACTION_BUTTON_SIZE
60 54
     },
61 55
 
62 56
     /**

+ 6
- 7
react/features/mobile/navigation/components/HeaderNavigationButton.js 查看文件

@@ -1,7 +1,6 @@
1 1
 // @flow
2 2
 
3 3
 import React from 'react';
4
-import { TouchableOpacity } from 'react-native-gesture-handler';
5 4
 import { Text, TouchableRipple } from 'react-native-paper';
6 5
 
7 6
 import { Icon } from '../../../base/icons';
@@ -48,14 +47,14 @@ const HeaderNavigationButton
48 47
             <>
49 48
                 {
50 49
                     src ? (
51
-                        <TouchableOpacity
50
+                        <TouchableRipple
52 51
                             onPress = { onPress }
53
-                            style = { styles.headerNavigationButton }>
52
+                            rippleColor = { BaseTheme.palette.screen02Header }
53
+                            style = { styles.headerNavigationButton } >
54 54
                             <Icon
55
-                                size = { 20 }
56
-                                src = { src }
57
-                                style = { styles.headerNavigationIcon } />
58
-                        </TouchableOpacity>
55
+                                size = { 24 }
56
+                                src = { src } />
57
+                        </TouchableRipple>
59 58
                     ) : (
60 59
                         <TouchableRipple
61 60
                             disabled = { disabled }

+ 9
- 25
react/features/mobile/navigation/screenOptions.js 查看文件

@@ -1,6 +1,4 @@
1
-import { TransitionPresets } from '@react-navigation/stack';
2 1
 import React from 'react';
3
-import { Platform } from 'react-native';
4 2
 
5 3
 import {
6 4
     Icon,
@@ -25,29 +23,11 @@ export const navigationContainerTheme = {
25 23
     }
26 24
 };
27 25
 
28
-/**
29
- * Default modal transition for the current platform.
30
- */
31
-export const conferenceModalPresentation = Platform.select({
32
-    ios: TransitionPresets.ModalPresentationIOS,
33
-    default: TransitionPresets.DefaultTransition
34
-});
35
-
36
-/**
37
- * Screen options and transition types.
38
- */
39
-export const fullScreenOptions = {
40
-    ...TransitionPresets.ModalTransition,
41
-    gestureEnabled: false,
42
-    headerShown: false
43
-};
44
-
45
-
46 26
 /**
47 27
  * Drawer navigator screens options and transition types.
48 28
  */
49 29
 export const drawerNavigatorScreenOptions = {
50
-    ...TransitionPresets.ModalTransition,
30
+    animation: 'default',
51 31
     gestureEnabled: true,
52 32
     headerShown: false
53 33
 };
@@ -57,7 +37,7 @@ export const drawerNavigatorScreenOptions = {
57 37
  * Drawer screen options and transition types.
58 38
  */
59 39
 export const drawerScreenOptions = {
60
-    ...TransitionPresets.ModalTransition,
40
+    animation: 'default',
61 41
     gestureEnabled: true,
62 42
     headerShown: true,
63 43
     headerStyle: {
@@ -151,7 +131,11 @@ export const helpScreenOptions = {
151 131
 /**
152 132
  * Screen options for conference.
153 133
  */
154
-export const conferenceScreenOptions = fullScreenOptions;
134
+export const conferenceScreenOptions = {
135
+    animation: 'default',
136
+    gestureEnabled: false,
137
+    headerShown: false
138
+};
155 139
 
156 140
 /**
157 141
  * Tab bar options for chat screen.
@@ -171,7 +155,7 @@ export const chatTabBarOptions = {
171 155
  * Screen options for presentation type modals.
172 156
  */
173 157
 export const presentationScreenOptions = {
174
-    ...conferenceModalPresentation,
158
+    animation: 'slide_from_right',
175 159
     headerBackTitleVisible: false,
176 160
     headerLeft: () => screenHeaderCloseButton(goBack),
177 161
     headerStatusBarHeight: 0,
@@ -258,7 +242,7 @@ export const gifsMenuOptions = presentationScreenOptions;
258 242
  * Screen options for shared document.
259 243
  */
260 244
 export const sharedDocumentScreenOptions = {
261
-    ...TransitionPresets.DefaultTransition,
245
+    animation: 'default',
262 246
     headerBackTitleVisible: false,
263 247
     headerShown: true,
264 248
     headerStyle: {

正在加载...
取消
保存