mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Remove usage of SafeAreaView from RNTester (#52129)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52129 This remove all the usages of SafeAreaView from RNTester. The problem is that we introduced a warning that SafEAreaView is deprecated and, therefore, we had a warning in debug mode. This was causing a yellow bubble to appear and the OSS E2E test started failing. ## Changelog: [Internal] - Reviewed By: cortinico Differential Revision: D76978227 fbshipit-source-id: c45a31bae1602bc307e4fbbd71e7987a8ed78858
This commit is contained in:
1 parent
b950fa2afb
commit
432ad09c41
2 files changed
+27
-28
No files matched your search
@@ -11,7 +11,7 @@
|
||||
import RNTesterDocumentationURL from './RNTesterDocumentationURL';
|
||||
import {type RNTesterTheme} from './RNTesterTheme';
|
||||
import * as React from 'react';
|
||||
import {Platform, SafeAreaView, StyleSheet, Text, View} from 'react-native';
|
||||
import {Platform, StyleSheet, Text, View} from 'react-native';
|
||||
|
||||
const HeaderIOS = ({
|
||||
children,
|
||||
@@ -25,20 +25,16 @@ const HeaderIOS = ({
|
||||
theme: RNTesterTheme,
|
||||
}) => {
|
||||
return (
|
||||
<SafeAreaView>
|
||||
<View
|
||||
style={[styles.header, {backgroundColor: theme.SystemBackgroundColor}]}>
|
||||
<View style={styles.headerCenter}>
|
||||
<Text style={{...styles.title, color: theme.LabelColor}}>
|
||||
{title}
|
||||
</Text>
|
||||
{documentationURL && (
|
||||
<RNTesterDocumentationURL documentationURL={documentationURL} />
|
||||
)}
|
||||
</View>
|
||||
{children != null && <View>{children}</View>}
|
||||
<View
|
||||
style={[styles.header, {backgroundColor: theme.SystemBackgroundColor}]}>
|
||||
<View style={styles.headerCenter}>
|
||||
<Text style={{...styles.title, color: theme.LabelColor}}>{title}</Text>
|
||||
{documentationURL && (
|
||||
<RNTesterDocumentationURL documentationURL={documentationURL} />
|
||||
)}
|
||||
</View>
|
||||
</SafeAreaView>
|
||||
{children != null && <View>{children}</View>}
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -54,17 +50,15 @@ const HeaderAndroid = ({
|
||||
theme: RNTesterTheme,
|
||||
}) => {
|
||||
return (
|
||||
<SafeAreaView>
|
||||
<View style={[styles.toolbar, {backgroundColor: theme.BackgroundColor}]}>
|
||||
<View style={styles.toolbarCenter}>
|
||||
<Text style={[styles.title, {color: theme.LabelColor}]}>{title}</Text>
|
||||
{documentationURL && (
|
||||
<RNTesterDocumentationURL documentationURL={documentationURL} />
|
||||
)}
|
||||
</View>
|
||||
{children != null && <View>{children}</View>}
|
||||
<View style={[styles.toolbar, {backgroundColor: theme.BackgroundColor}]}>
|
||||
<View style={styles.toolbarCenter}>
|
||||
<Text style={[styles.title, {color: theme.LabelColor}]}>{title}</Text>
|
||||
{documentationURL && (
|
||||
<RNTesterDocumentationURL documentationURL={documentationURL} />
|
||||
)}
|
||||
</View>
|
||||
</SafeAreaView>
|
||||
{children != null && <View>{children}</View>}
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -104,6 +98,7 @@ const styles = StyleSheet.create({
|
||||
header: {
|
||||
height: 40,
|
||||
flexDirection: 'row',
|
||||
marginTop: Platform.OS === 'ios' ? 50 : 0,
|
||||
},
|
||||
headerCenter: {
|
||||
flex: 1,
|
||||
|
||||
@@ -13,7 +13,7 @@ import RNTesterTitle from './RNTesterTitle';
|
||||
import {useContext} from 'react';
|
||||
|
||||
const React = require('react');
|
||||
const {SafeAreaView, ScrollView, StyleSheet, View} = require('react-native');
|
||||
const {Platform, ScrollView, StyleSheet, View} = require('react-native');
|
||||
|
||||
type Props = $ReadOnly<{
|
||||
children?: React.Node,
|
||||
@@ -25,10 +25,14 @@ function RNTesterPage({children, title, noScroll}: Props): React.Node {
|
||||
const theme = useContext(RNTesterThemeContext);
|
||||
|
||||
return (
|
||||
<SafeAreaView
|
||||
<View
|
||||
style={[
|
||||
styles.background,
|
||||
{backgroundColor: theme.SecondarySystemBackgroundColor},
|
||||
{
|
||||
backgroundColor: theme.SecondarySystemBackgroundColor,
|
||||
marginTop: Platform.OS === 'ios' ? 50 : 20,
|
||||
marginBottom: Platform.OS === 'ios' ? 20 : 10,
|
||||
},
|
||||
]}>
|
||||
{title && <RNTesterTitle title={title} />}
|
||||
{noScroll ? (
|
||||
@@ -43,7 +47,7 @@ function RNTesterPage({children, title, noScroll}: Props): React.Node {
|
||||
{children}
|
||||
</ScrollView>
|
||||
)}
|
||||
</SafeAreaView>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user