mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
logbox footer buttons fix safearea (#36427)
Summary: The logbox buttons on iOS are not easy to reach since they draw in the safe area. This pr should fix that. ## Changelog [IOS] [FIXED] - logbox footer buttons respect safe area Pull Request resolved: https://github.com/facebook/react-native/pull/36427 Test Plan: | after | before | |---|---| |  |  Reviewed By: NickGerleman Differential Revision: D43957242 Pulled By: javache fbshipit-source-id: 9d26bc52b45c110f7bc3b0d6c1da1ed2d31a154c
This commit is contained in:
committed by
Facebook GitHub Bot
parent
a3102175c5
commit
6d6b1fdc75
@@ -10,10 +10,10 @@
|
||||
|
||||
import type {LogLevel} from '../Data/LogBoxLog';
|
||||
|
||||
import SafeAreaView from '../../Components/SafeAreaView/SafeAreaView';
|
||||
import View from '../../Components/View/View';
|
||||
import StyleSheet from '../../StyleSheet/StyleSheet';
|
||||
import Text from '../../Text/Text';
|
||||
import DeviceInfo from '../../Utilities/DeviceInfo';
|
||||
import LogBoxButton from './LogBoxButton';
|
||||
import * as LogBoxStyle from './LogBoxStyle';
|
||||
import * as React from 'react';
|
||||
@@ -52,39 +52,21 @@ type ButtonProps = $ReadOnly<{|
|
||||
|
||||
function FooterButton(props: ButtonProps): React.Node {
|
||||
return (
|
||||
<LogBoxButton
|
||||
backgroundColor={{
|
||||
default: 'transparent',
|
||||
pressed: LogBoxStyle.getBackgroundDarkColor(),
|
||||
}}
|
||||
onPress={props.onPress}
|
||||
style={buttonStyles.safeArea}>
|
||||
<View style={buttonStyles.content}>
|
||||
<Text style={buttonStyles.label}>{props.text}</Text>
|
||||
</View>
|
||||
</LogBoxButton>
|
||||
<SafeAreaView style={styles.button}>
|
||||
<LogBoxButton
|
||||
backgroundColor={{
|
||||
default: 'transparent',
|
||||
pressed: LogBoxStyle.getBackgroundDarkColor(),
|
||||
}}
|
||||
onPress={props.onPress}>
|
||||
<View style={styles.buttonContent}>
|
||||
<Text style={styles.buttonLabel}>{props.text}</Text>
|
||||
</View>
|
||||
</LogBoxButton>
|
||||
</SafeAreaView>
|
||||
);
|
||||
}
|
||||
|
||||
const buttonStyles = StyleSheet.create({
|
||||
safeArea: {
|
||||
flex: 1,
|
||||
// $FlowFixMe[sketchy-null-bool]
|
||||
paddingBottom: DeviceInfo.getConstants().isIPhoneX_deprecated ? 30 : 0,
|
||||
},
|
||||
content: {
|
||||
alignItems: 'center',
|
||||
height: 48,
|
||||
justifyContent: 'center',
|
||||
},
|
||||
label: {
|
||||
color: LogBoxStyle.getTextColor(1),
|
||||
fontSize: 14,
|
||||
includeFontPadding: false,
|
||||
lineHeight: 20,
|
||||
},
|
||||
});
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
root: {
|
||||
backgroundColor: LogBoxStyle.getBackgroundColor(1),
|
||||
@@ -97,6 +79,17 @@ const styles = StyleSheet.create({
|
||||
button: {
|
||||
flex: 1,
|
||||
},
|
||||
buttonContent: {
|
||||
alignItems: 'center',
|
||||
height: 48,
|
||||
justifyContent: 'center',
|
||||
},
|
||||
buttonLabel: {
|
||||
color: LogBoxStyle.getTextColor(1),
|
||||
fontSize: 14,
|
||||
includeFontPadding: false,
|
||||
lineHeight: 20,
|
||||
},
|
||||
syntaxErrorText: {
|
||||
textAlign: 'center',
|
||||
width: '100%',
|
||||
|
||||
Reference in New Issue
Block a user