@react-native/new-app-screen 0.81.0-rc.1 → 0.81.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native/new-app-screen",
3
- "version": "0.81.0-rc.1",
3
+ "version": "0.81.0-rc.2",
4
4
  "description": "NewAppScreen component for React Native",
5
5
  "keywords": [
6
6
  "react-native"
@@ -13,10 +13,7 @@ import {ThemedText, useTheme} from './Theme';
13
13
  import * as React from 'react';
14
14
  import {
15
15
  Image,
16
- Platform,
17
- SafeAreaView,
18
16
  ScrollView,
19
- StatusBar,
20
17
  StyleSheet,
21
18
  Text,
22
19
  TouchableHighlight,
@@ -29,24 +26,32 @@ import {version as ReactNativeVersion} from 'react-native/Libraries/Core/ReactNa
29
26
 
30
27
  export type NewAppScreenProps = $ReadOnly<{
31
28
  templateFileName?: string,
29
+ safeAreaInsets?: $ReadOnly<{
30
+ top: number,
31
+ bottom: number,
32
+ left: number,
33
+ right: number,
34
+ }>,
32
35
  }>;
33
36
 
34
- const statusBarHeightOffset = Platform.select({
35
- android: StatusBar.currentHeight || 0,
36
- default: 0,
37
- });
38
-
39
37
  export default function NewAppScreen({
40
38
  templateFileName = 'App.tsx',
39
+ safeAreaInsets = {top: 0, bottom: 0, left: 0, right: 0},
41
40
  }: NewAppScreenProps): React.Node {
42
41
  const {colors} = useTheme();
43
42
  const isDarkMode = useColorScheme() === 'dark';
44
43
  const isLargeScreen = useWindowDimensions().width > 600;
45
44
 
46
45
  return (
47
- <SafeAreaView style={{backgroundColor: colors.background}}>
48
- <ScrollView>
49
- <View style={[styles.container, {paddingTop: statusBarHeightOffset}]}>
46
+ <View
47
+ style={{
48
+ backgroundColor: colors.background,
49
+ paddingTop: safeAreaInsets.top,
50
+ paddingLeft: safeAreaInsets.left,
51
+ paddingRight: safeAreaInsets.right,
52
+ }}>
53
+ <ScrollView style={{paddingBottom: safeAreaInsets.bottom}}>
54
+ <View style={styles.container}>
50
55
  <View style={styles.header}>
51
56
  <Image
52
57
  style={styles.logo}
@@ -99,7 +104,7 @@ export default function NewAppScreen({
99
104
  </View>
100
105
  </View>
101
106
  </ScrollView>
102
- </SafeAreaView>
107
+ </View>
103
108
  );
104
109
  }
105
110
 
package/src/index.d.ts CHANGED
@@ -11,6 +11,14 @@ import type * as React from 'react';
11
11
 
12
12
  export type NewAppScreenProps = Readonly<{
13
13
  templateFileName?: string | undefined;
14
+ safeAreaInsets?:
15
+ | Readonly<{
16
+ top: number;
17
+ bottom: number;
18
+ left: number;
19
+ right: number;
20
+ }>
21
+ | undefined;
14
22
  }>;
15
23
 
16
24
  export function NewAppScreen(props: NewAppScreenProps): React.ReactNode;