forked from dominicstop/react-native-ios-context-menu
-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.tsx
131 lines (114 loc) · 3.35 KB
/
App.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
import * as React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { HomeScreen } from './src/screens/HomeScreen';
import { TestScreen } from './src/screens/Test01Screen';
import { Test02Screen } from './src/screens/Test02Screen';
import { Test03Screen } from './src/screens/Test03Screen';
import { Test04Screen } from './src/screens/Test04Screen';
import { Test05Screen } from './src/screens/Test05Screen';
import { Test06Screen } from './src/screens/Test06Screen';
import { Test07Screen } from './src/screens/Test07Screen';
import { SHARED_ENV } from './src/constants/SharedEnv';
import { View } from 'react-native';
import { setSharedEnvForRNICleanableViewRegistry, setSharedEnvForRNIUtilitiesModule } from 'react-native-ios-utilities';
const shouldEnableTabs =
SHARED_ENV.enableReactNavigation && SHARED_ENV.enableTabNavigation;
function Tab1StackScreen() {
if(shouldEnableTabs){
const Tab1Stack = createNativeStackNavigator();
return (
<Tab1Stack.Navigator initialRouteName="Home">
<Tab1Stack.Screen
name="Home"
component={HomeScreen}
/>
<Tab1Stack.Screen
name="Test"
component={TestScreen}
/>
</Tab1Stack.Navigator>
);
} else {
return null;
};
};
export default function App() {
if(SHARED_ENV.shouldRenderNothing){
return (
<View/>
);
};
if(shouldEnableTabs){
const TabNavigator = createBottomTabNavigator();
return(
<NavigationContainer>
<TabNavigator.Navigator>
<TabNavigator.Screen
name="Tab1"
component={Tab1StackScreen}
/>
<TabNavigator.Screen
name="Tab2"
component={HomeScreen}
/>
</TabNavigator.Navigator>
</NavigationContainer>
);
} else if(SHARED_ENV.enableReactNavigation){
const Stack = createNativeStackNavigator();
return(
<NavigationContainer>
<Stack.Navigator initialRouteName="Home">
<Stack.Screen
name="Home"
component={HomeScreen}
/>
<Stack.Screen
name="Test"
component={TestScreen}
/>
<Stack.Screen
name="Test02"
component={Test02Screen}
/>
<Stack.Screen
name="Test03"
component={Test03Screen}
/>
<Stack.Screen
name="Test04"
component={Test04Screen}
/>
<Stack.Screen
name="Test05"
component={Test05Screen}
/>
<Stack.Screen
name="Test06"
component={Test06Screen}
/>
<Stack.Screen
name="Test07"
component={Test07Screen}
/>
</Stack.Navigator>
</NavigationContainer>
);
};
return (
<HomeScreen/>
);
};
setSharedEnvForRNIUtilitiesModule({
debugShouldLogViewRegistryEntryRemoval: true,
overrideEnableLogStackTrace: false,
overrideShouldLogFileMetadata: true,
overrideShouldLogFilePath: true
});
setSharedEnvForRNICleanableViewRegistry({
debugShouldLogCleanup: true,
debugShouldLogRegister: true,
shouldGloballyDisableCleanup: false
});