From 4f0b9e25545006fa22e745fdc8d0e6761b0e6d4e Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Tue, 12 Jun 2018 17:35:32 -0700 Subject: [PATCH] YellowBox: Apply SafeAreaView in Header Summary: Uses `SafeAreaView` in the YellowBox inspector header so that it does not collide with the status bar. Reviewed By: sahrens Differential Revision: D8374861 fbshipit-source-id: e67358ac9268db8291cacf79df402f3bd5a2173d --- .../YellowBox/UI/YellowBoxInspectorHeader.js | 39 ++++++++++++------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/Libraries/YellowBox/UI/YellowBoxInspectorHeader.js b/Libraries/YellowBox/UI/YellowBoxInspectorHeader.js index 4ed124eaba22ff..b84afd8ca4470e 100644 --- a/Libraries/YellowBox/UI/YellowBoxInspectorHeader.js +++ b/Libraries/YellowBox/UI/YellowBoxInspectorHeader.js @@ -12,6 +12,7 @@ const Platform = require('Platform'); const React = require('React'); +const SafeAreaView = require('SafeAreaView'); const StyleSheet = require('StyleSheet'); const Text = require('Text'); const UTFSequence = require('UTFSequence'); @@ -37,21 +38,23 @@ const YellowBoxInspectorHeader = (props: Props): React.Node => { : `Occurrence ${props.selectedIndex + 1} of ${props.warnings.length}`; return ( - - props.onSelectIndex(prevIndex)} - /> - - {titleText} + + + props.onSelectIndex(prevIndex)} + /> + + {titleText} + + props.onSelectIndex(nextIndex)} + /> - props.onSelectIndex(nextIndex)} - /> - + ); }; @@ -63,6 +66,10 @@ const YellowBoxInspectorHeaderButton = ( |}>, ): React.Node => ( {props.disabled ? null : ( @@ -72,6 +79,9 @@ const YellowBoxInspectorHeaderButton = ( ); const styles = StyleSheet.create({ + root: { + backgroundColor: YellowBoxStyle.getBackgroundColor(0.95), + }, header: { flexDirection: 'row', height: Platform.select({ @@ -92,7 +102,6 @@ const styles = StyleSheet.create({ }, headerTitle: { alignItems: 'center', - backgroundColor: YellowBoxStyle.getBackgroundColor(0.95), flex: 1, justifyContent: 'center', },