Skip to content

Commit

Permalink
[skip ci] Add static zIndex example and e2e test to Catalyst (faceboo…
Browse files Browse the repository at this point in the history
…k#42317)

Summary:

Added a complicated zIndex test and corresponding screenshot test for it.

bypass-github-export-checks

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D52439963
  • Loading branch information
joevilches authored and facebook-github-bot committed Jan 18, 2024
1 parent fed8987 commit df7cf7f
Showing 1 changed file with 77 additions and 0 deletions.
77 changes: 77 additions & 0 deletions packages/rn-tester/js/examples/View/ViewExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,78 @@ class ZIndexExample extends React.Component<
};
}

function PositionStaticZIndexExample(): React.Node {
return (
<View
testID="view-test-zindex-with-static"
style={{backgroundColor: 'yellow', flexDirection: 'row'}}>
<View
style={{
backgroundColor: 'red',
width: 100,
height: 100,
position: 'relative',
left: 10,
}}>
<View
style={{
backgroundColor: 'purple',
width: 50,
height: 50,
top: 30,
left: 65,
position: 'relative',
}}
/>
</View>
<View
style={{
backgroundColor: 'blue',
width: 100,
height: 100,
zIndex: 100,
position: 'static',
}}>
<View
style={{
backgroundColor: 'orange',
width: 50,
height: 50,
top: 10,
position: 'relative',
}}
/>
<View
style={{
backgroundColor: 'brown',
width: 50,
height: 50,
position: 'static',
}}>
<View
style={{
backgroundColor: 'black',
width: 25,
height: 25,
top: -10,
position: 'relative',
}}
/>
</View>
</View>
<View
style={{
backgroundColor: 'green',
width: 100,
height: 100,
position: 'relative',
left: -20,
}}
/>
</View>
);
}

class DisplayNoneStyle extends React.Component<
$ReadOnly<{||}>,
{|
Expand Down Expand Up @@ -663,6 +735,11 @@ export default ({
return <ZIndexExample />;
},
},
{
title: 'ZIndex With Static',
name: 'zindex-with-static',
render: PositionStaticZIndexExample,
},
{
title: '`display: none` style',
name: 'display-none',
Expand Down

0 comments on commit df7cf7f

Please sign in to comment.