-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
89 lines (82 loc) · 2.51 KB
/
App.js
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
import 'react-native-gesture-handler';
import * as React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import { View, Text, Dimensions, StyleSheet, Platform} from 'react-native';
import {widthPercentageToDP as wp, heightPercentageToDP as hp} from 'react-native-responsive-screen';
import { createMaterialTopTabNavigator } from '@react-navigation/material-top-tabs';
import I18n from "./src/utils/I18n";
// import the routes
import Main from "./src/screens/Main";
import Control from "./src/screens/Control";
import Learn from "./src/screens/Learn";
import Settings from "./src/screens/Settings";
const initialLayout = { width: Dimensions.get('window').width};
const Stack = createStackNavigator();
const InitialStack = createStackNavigator();
const AppStack = createMaterialTopTabNavigator();
function InitialScreens() {
return (
<InitialStack.Navigator
headerMode="none"
>
<InitialStack.Screen name="Main" component={Main} />
</InitialStack.Navigator>
);
}
function AppScreens() {
return (
<AppStack.Navigator
headerMode="none"
initialRouteName={Main}
backBehavior={'none'}
lazy={true}
initialLayout={initialLayout}
style={{backgroundColor:'white'}}
tabBarOptions={{
activeTintColor: '#10C8B1',
inactiveTintColor: '#C5CCD6',
indicatorStyle: {backgroundColor:'#10C8B1'},
labelStyle: {
fontSize: hp("1.8%"),
fontWeight:'bold',
...Platform.select({
android: {
fontFamily:'Roboto'
}
})
},
style:{
backgroundColor: 'white',
...Platform.select({
ios: {
marginTop:hp('3.7%')
},
android: {
marginTop:hp('0%'),
fontFamily:'Roboto'
}
})},
}}
>
<AppStack.Screen name={I18n.t("control")} component={Control} />
{/* <AppStack.Screen name="Learn " component={Learn} /> */}
<AppStack.Screen name={I18n.t("settings")} component={Settings} />
</AppStack.Navigator>
);
}
export default function app() {
return (
<NavigationContainer>
<Stack.Navigator headerMode="none">
<Stack.Screen name="InitialStack" component={InitialScreens} />
<Stack.Screen name="AppStack" component={AppScreens} />
</Stack.Navigator>
</NavigationContainer>
)
}
const styles = StyleSheet.create({
scene: {
flex: 1
}
});