mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Add RNTester box sizing example and e2e test round 2
Summary: Add the tests back! Changelog: [Internal] Reviewed By: NickGerleman Differential Revision: D63844898 fbshipit-source-id: 6c08557e54be01a1dc156cf72f187a5bb6c5d791
This commit is contained in:
committed by
Facebook GitHub Bot
parent
3ca796edc3
commit
3f1e381ded
@@ -668,6 +668,37 @@ function OutlineExample(): React.Node {
|
||||
);
|
||||
}
|
||||
|
||||
function BoxSizingExample(): React.Node {
|
||||
const styles = StyleSheet.create({
|
||||
boxSizingBox: {
|
||||
padding: 5,
|
||||
backgroundColor: 'green',
|
||||
borderWidth: 5,
|
||||
margin: 10,
|
||||
width: 50,
|
||||
height: 25,
|
||||
},
|
||||
boxSizingChild: {
|
||||
backgroundColor: 'red',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
},
|
||||
});
|
||||
|
||||
return (
|
||||
<View testID={'view-test-box-sizing'}>
|
||||
<Text>Content box 50x25</Text>
|
||||
<View style={[styles.boxSizingBox, {boxSizing: 'content-box'}]}>
|
||||
<View style={styles.boxSizingChild} />
|
||||
</View>
|
||||
<Text>Border box 50x25</Text>
|
||||
<View style={[styles.boxSizingBox, {boxSizing: 'border-box'}]}>
|
||||
<View style={styles.boxSizingChild} />
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
export default ({
|
||||
title: 'View',
|
||||
documentationURL: 'https://reactnative.dev/docs/view',
|
||||
@@ -1312,5 +1343,10 @@ export default ({
|
||||
name: 'outline',
|
||||
render: OutlineExample,
|
||||
},
|
||||
{
|
||||
title: 'Box Sizing',
|
||||
name: 'box-sizing',
|
||||
render: BoxSizingExample,
|
||||
},
|
||||
],
|
||||
}: RNTesterModule);
|
||||
|
||||
Reference in New Issue
Block a user