-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
115 lines (104 loc) · 2.83 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
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
/**
*
* @format
* @flow strict-local
*/
import React from 'react';
import {LogBox} from 'react-native';
import {createDrawerNavigator} from '@react-navigation/drawer';
import {NavigationContainer} from '@react-navigation/native';
import Feather from 'react-native-vector-icons/Feather';
import Fontisto from 'react-native-vector-icons/Fontisto';
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
import DrawerContents from './services/DrawerItems';
import AnimatedSplash from 'react-native-animated-splash-screen';
import {AboutScreen, CounterTabs, InfoScreen} from './src/screens';
import Colors from './services/colors';
import {ScreenSize} from './services/config';
const Drawer = createDrawerNavigator();
const DrawerContainer = () => {
return (
<NavigationContainer>
<Drawer.Navigator
initialRouteName="Study & Track"
drawerContentOptions={{
activeTintColor: Colors.pureLightBlue,
inactiveTintColor: Colors.black,
itemStyle: {borderRadius: 15},
}}
drawerContent={(props) => <DrawerContents {...props} />}>
<Drawer.Screen
name="Study & Track"
component={CounterTabs}
options={{
drawerIcon: () => (
<Fontisto
name="stopwatch"
size={24}
color={Colors.pureLightBlue}
/>
),
}}
/>
<Drawer.Screen
name="About The Developer"
component={AboutScreen}
options={{
drawerIcon: () => (
<MaterialIcons
name="face"
size={24}
color={Colors.pureLightBlue}
/>
),
}}
/>
<Drawer.Screen
name="Info"
component={InfoScreen}
options={{
drawerIcon: () => (
<Feather name="info" size={24} color={Colors.pureLightBlue} />
),
}}
/>
</Drawer.Navigator>
</NavigationContainer>
);
};
class App extends React.Component {
state = {
loaded: false,
bgImage: false,
};
enableSplash = () => {
this.setState({loaded: true, bgImage: false});
};
disableSplash = () => {
this.setState({loaded: false, bgImage: true});
};
loadSplash = () => {
setTimeout(() => {
this.enableSplash();
}, 3000);
this.disableSplash();
};
componentDidMount() {
this.loadSplash();
LogBox.ignoreAllLogs();
}
render() {
return (
<AnimatedSplash
translucent={true}
isLoaded={this.state.loaded}
logoImage={require('./assets/splashScreen/logo.png')}
disableBackgroundImage={this.state.bgImage}
logoHeight={400}
logoWidth={400}>
<DrawerContainer />
</AnimatedSplash>
);
}
}
export default App;