UNPKG

967 BJavaScriptView Raw
1import React, { Component, } from 'react';
2import { Modal, TouchableWithoutFeedback, View, StyleSheet, } from 'react-native';
3export class Props {
4}
5const styles = StyleSheet.create({
6 overlay: {
7 backgroundColor: 'rgba(0, 0, 0, .3)',
8 position: 'absolute',
9 top: 0,
10 bottom: 0,
11 left: 0,
12 right: 0,
13 },
14});
15export default class Overlay extends Component {
16 constructor() {
17 super(...arguments);
18 this.NOOP = () => { };
19 }
20 render() {
21 const { children, onPress, style, visible } = this.props;
22 return (React.createElement(Modal, { animationType: "fade", onRequestClose: this.NOOP, transparent: true, visible: visible },
23 React.createElement(TouchableWithoutFeedback, { onPress: onPress },
24 React.createElement(View, { style: [styles.overlay, style] })),
25 children));
26 }
27}
28Overlay.defaultProps = new Props();
29//# sourceMappingURL=index.js.map
\No newline at end of file