-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathApp.tsx
67 lines (61 loc) · 1.43 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
import React from 'react';
import {StyleSheet, View, StatusBar} from 'react-native';
import {
JetConfig,
JetProvider,
ConnectionText,
StatusEmoji,
StatusText,
} from 'jet';
// Registering an error handler that always throw unhandled exceptions
// This is to enable Jet to exit on uncaught errors
const originalHandler = ErrorUtils.getGlobalHandler();
ErrorUtils.setGlobalHandler((err, isFatal) => {
originalHandler(err, isFatal);
throw err;
});
function loadTests(_: JetConfig) {
const tests = (require as any).context('./e2e', true, /\.jet\.ts$/);
tests.keys().forEach(tests);
}
function App() {
return (
<JetProvider tests={loadTests}>
<StatusBar hidden />
<View style={styles.container}>
<ConnectionText style={styles.connectionText} />
<View style={styles.statusContainer}>
<StatusEmoji style={styles.statusEmoji} />
<StatusText style={styles.statusText} />
</View>
</View>
</JetProvider>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
},
statusContainer: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
statusEmoji: {
fontSize: 30,
margin: 30,
textAlign: 'center',
},
statusText: {
fontSize: 20,
margin: 20,
textAlign: 'center',
color: 'black',
},
connectionText: {
textAlign: 'center',
color: 'black',
},
});
export default App;