31 lines
1.0 KiB
React
31 lines
1.0 KiB
React
// Metro module 5621 (f5622).
|
|
import { forwardRef, useState, useImperativeHandle, useEffect } from "react";
|
|
import { View, StyleSheet } from "react-native";
|
|
let styles;
|
|
const r26 = forwardRef(function CardSheet(props, a1) {
|
|
const { enabled, layout, style, ...props2 } = props;
|
|
const [state, setState] = useState(false);
|
|
const [pointerEvents, setState2] = useState("auto");
|
|
useImperativeHandle(a1, () => ({
|
|
setPointerEvents: setState2
|
|
}));
|
|
useEffect(() => {
|
|
if (typeof globalThis.document !== "undefined" && document.body) {
|
|
const clientWidth = document.body.clientWidth;
|
|
const clientHeight = document.body.clientHeight;
|
|
setState(clientWidth === layout.width && clientHeight === layout.height);
|
|
}
|
|
}, [layout.height, layout.width]);
|
|
return <View {...props2} pointerEvents={pointerEvents} style={[enabled && state ? styles.page : styles.card, style]} />;
|
|
});
|
|
styles = StyleSheet.create({
|
|
page: {
|
|
minHeight: "100%"
|
|
},
|
|
card: {
|
|
flex: 1,
|
|
overflow: "hidden"
|
|
}
|
|
});
|
|
export default r26;
|