mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-06-17 06:19:16 +08:00
Summary: This diff changes the style of the Modal container style as a pre-requisite to implement Modal on Fabric. In the current version of React Native the size of the View container is determined at runtime using the size of the screen. The size of this view is set overriding the Widht and Height of this Container View (using the screen size), in Fabric we can not update the size of that view, instead we set the size of the RCTModalHostView to take the size of the whole screen. Since the RCTModalHostView has an absolute position and it has the size of the screen, making this change should be enough to keep backward compatibility and be able to implement Modal on Fabric Reviewed By: JoshuaGross Differential Revision: D15067616 fbshipit-source-id: d7302ef3afc503adfee10e12fb6d0ebd371fb7ed
80 lines
1.3 KiB
Plaintext
80 lines
1.3 KiB
Plaintext
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
exports[`<Modal /> should render as <Modal> when mocked 1`] = `
|
|
<Modal
|
|
hardwareAccelerated={false}
|
|
visible={true}
|
|
>
|
|
<View />
|
|
</Modal>
|
|
`;
|
|
|
|
exports[`<Modal /> should render as <RCTModalHostView> when not mocked 1`] = `
|
|
<RCTModalHostView
|
|
animationType="none"
|
|
hardwareAccelerated={false}
|
|
identifier={1}
|
|
onStartShouldSetResponder={[Function]}
|
|
presentationStyle="fullScreen"
|
|
style={
|
|
Object {
|
|
"position": "absolute",
|
|
}
|
|
}
|
|
>
|
|
<View
|
|
style={
|
|
Array [
|
|
Object {
|
|
"flex": 1,
|
|
"left": 0,
|
|
"top": 0,
|
|
},
|
|
Object {
|
|
"backgroundColor": "white",
|
|
},
|
|
]
|
|
}
|
|
>
|
|
<View
|
|
pointerEvents="box-none"
|
|
style={
|
|
Object {
|
|
"flex": 1,
|
|
}
|
|
}
|
|
>
|
|
<View
|
|
collapsable={true}
|
|
pointerEvents="box-none"
|
|
style={
|
|
Object {
|
|
"flex": 1,
|
|
}
|
|
}
|
|
>
|
|
<View />
|
|
</View>
|
|
</View>
|
|
</View>
|
|
</RCTModalHostView>
|
|
`;
|
|
|
|
exports[`<Modal /> should shallow render as <Component> when mocked 1`] = `
|
|
<Component
|
|
hardwareAccelerated={false}
|
|
visible={true}
|
|
>
|
|
<View />
|
|
</Component>
|
|
`;
|
|
|
|
exports[`<Modal /> should shallow render as <Modal> when not mocked 1`] = `
|
|
<Modal
|
|
hardwareAccelerated={false}
|
|
visible={true}
|
|
>
|
|
<View />
|
|
</Modal>
|
|
`;
|