Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 22 additions & 9 deletions Libraries/ReactNative/YellowBox.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -247,7 +247,6 @@ const WarningInspector = ({
warning,
stacktraceVisible,
onDismiss,
onDismissAll,
onMinimize,
toggleStacktrace,
}) => {
Expand DownExpand Up@@ -301,13 +300,6 @@ const WarningInspector = ({
underlayColor="transparent">
<Text style={styles.inspectorButtonText}>Dismiss</Text>
</TouchableHighlight>
<TouchableHighlight
activeOpacity={0.5}
onPress={onDismissAll}
style={styles.inspectorButton}
underlayColor="transparent">
<Text style={styles.inspectorButtonText}>Dismiss All</Text>
</TouchableHighlight>
</View>
</SafeAreaView>
</View>
Expand DownExpand Up@@ -392,6 +384,8 @@ class YellowBox extends React.Component<
}
const ScrollView = require('ScrollView');
const View = require('View');
const Text = require('Text');
const TouchableHighlight = require('TouchableHighlight');

const {inspecting, stacktraceVisible} = this.state;
const inspector =
Expand All@@ -401,7 +395,6 @@ class YellowBox extends React.Component<
warning={inspecting}
stacktraceVisible={stacktraceVisible}
onDismiss={() => this.dismissWarning(inspecting)}
onDismissAll={() => this.dismissWarning(null)}
onMinimize={() => this.setState({inspecting: null})}
toggleStacktrace={() =>
this.setState({stacktraceVisible: !stacktraceVisible})
Expand DownExpand Up@@ -431,6 +424,13 @@ class YellowBox extends React.Component<
];
return (
<View style={inspector ? styles.fullScreen : listStyle}>
{!inspector && (
<TouchableHighlight
style={styles.dismissAllContainer}
onPress={() => this.dismissWarning(null)}>
<Text style={styles.dismissAll}>Dismiss All</Text>
</TouchableHighlight>
)}
<ScrollView style={listStyle} scrollsToTop={false}>
{rows}
</ScrollView>
Expand DownExpand Up@@ -535,6 +535,19 @@ const styles = StyleSheet.create({
marginLeft: 15,
marginRight: 15,
},
dismissAllContainer: {
height: 20,
justifyContent: 'center',
marginTop: -30,
marginRight: 5,
backgroundColor: backgroundColor(0.95),
alignSelf: 'flex-end',
paddingHorizontal: 10,
borderRadius: 10,
},
dismissAll: {
color: 'white',
},
});

module.exports = YellowBox;