-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
130 lines (117 loc) · 2.79 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/* --------------------------------------------------------
* Author Trần Đức Tiến
* Email [email protected]
* Phone 0972970075
*
* Created: 2019-09-17 17:26:32
*------------------------------------------------------- */
import React, { useState, useEffect } from 'react';
import PropTypes from 'prop-types';
import { Provider } from 'react-redux';
import { Platform, StatusBar, StyleSheet, View } from 'react-native';
import { ThemeProvider } from 'react-native-elements';
import Ionicons from 'react-native-vector-icons/Ionicons';
import FontAwesome from 'react-native-vector-icons/FontAwesome';
import store from 'src/redux/store';
import AppNavigator from 'src/navigation/AppNavigator';
const theme = {
colors: {
primary: '#019fe6',
secondary: '#fff',
},
Button: {
buttonStyle: {
borderRadius: 30,
},
},
Input: {
containerStyle: {
width: '100%',
borderBottomWidth: 0,
marginBottom: 20,
},
inputStyle: {
width: '100%',
borderBottomWidth: 0,
color: '#98a2b0',
paddingRight: 15,
paddingLeft: 15,
borderRadius: 30,
backgroundColor: '#e7ebed',
marginLeft: -10,
marginRight: -10,
},
inputContainerStyle: {
borderRadius: 30,
backgroundColor: '#e7ebed',
// color: '#636e86',
width: '100%',
borderBottomWidth: 0,
},
labelStyle: {
marginLeft: -10,
marginRight: -10,
color: '#636e85',
marginBottom: 7,
},
errorStyle: {
marginLeft: -10,
marginRight: -10,
},
},
};
function handleLoadingError(error) {
// In this case, you might want to report the error to your error reporting
// service, for example Sentry
console.warn(error);
}
function handleFinishLoading(setLoadingComplete) {
setLoadingComplete(true);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
},
});
async function loadResourcesAsync() {
await Promise.all([
// Asset.loadAsync([
// require('./src/assets/images/robot-dev.png'),
// require('./src/assets/images/robot-prod.png'),
// ]),
]);
}
export default function App(props) {
const [isLoadingComplete, setLoadingComplete] = useState(false);
useEffect(() => {
console.disableYellowBox = true;
Ionicons.loadFont();
FontAwesome.loadFont();
});
// if (!isLoadingComplete && !props.skipLoadingScreen) {
// return (
// <AppLoading
// startAsync={loadResourcesAsync}
// onError={handleLoadingError}
// onFinish={() => handleFinishLoading(setLoadingComplete)}
// />
// );
// }
return (
<Provider store={store}>
<View style={styles.container}>
{Platform.OS === 'ios' && <StatusBar barStyle="light-content" />}
<ThemeProvider theme={theme}>
<AppNavigator />
</ThemeProvider>
</View>
</Provider>
);
}
App.propTypes = {
skipLoadingScreen: PropTypes.bool,
};
App.defaultProps = {
skipLoadingScreen: false,
};