Skip to content

Commit 8592e65

Browse files
committed
test: alter test UI structure for modularity / safe area
- this should allow us to slice in other components - this also allows all of the test UI to show up despite device cutouts etc note that react-native-safe-area-context is the real way to do this, but adding a dependency is overkill when brute-force padding / margin will do for a one-page test app
1 parent efa573a commit 8592e65

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

tests/app.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*/
1818

1919
import React from 'react';
20-
import { StyleSheet, View, StatusBar, AppRegistry, LogBox } from 'react-native';
20+
import { StyleSheet, View, StatusBar, AppRegistry } from 'react-native';
2121

2222
import { JetProvider, ConnectionText, StatusEmoji, StatusText } from 'jet';
2323

@@ -263,23 +263,30 @@ function loadTests(_) {
263263

264264
function App() {
265265
return (
266-
<JetProvider tests={loadTests}>
266+
<>
267267
<StatusBar hidden />
268268
<View style={styles.container}>
269-
<ConnectionText style={styles.connectionText} />
270-
<View style={styles.statusContainer}>
271-
<StatusEmoji style={styles.statusEmoji} />
272-
<StatusText style={styles.statusText} />
273-
</View>
269+
<JetProvider tests={loadTests}>
270+
<ConnectionText style={styles.connectionText} />
271+
<View style={styles.statusContainer}>
272+
<StatusEmoji style={styles.statusEmoji} />
273+
<StatusText style={styles.statusText} />
274+
</View>
275+
</JetProvider>
274276
</View>
275-
</JetProvider>
277+
</>
276278
);
277279
}
278280

279281
const styles = StyleSheet.create({
280282
container: {
281283
flex: 1,
282284
backgroundColor: '#fff',
285+
// instead of depending on react-native-safe-area-context to avoid
286+
// colliding with system UI we are just going to pad things out for simplicity
287+
marginTop: 60,
288+
paddingHorizontal: '5%',
289+
paddingBottom: '5%',
283290
},
284291
statusContainer: {
285292
flex: 1,

0 commit comments

Comments
 (0)