text: var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.Overlay=Overlay;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _overlays=require("@react-native-aria/overlays");var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _hooks=require("../../../hooks");var _ExitAnimationContext=require("./ExitAnimationContext");var _jsxFileName="/Users/suraj/Sites/projects/NativeBase/src/components/primitives/Overlay/Overlay.tsx";function Overlay(_ref){var children=_ref.children,isOpen=_ref.isOpen,_ref$useRNModalOnAndr=_ref.useRNModalOnAndroid,useRNModalOnAndroid=_ref$useRNModalOnAndr===void 0?false:_ref$useRNModalOnAndr,_ref$isKeyboardDismis=_ref.isKeyboardDismissable,isKeyboardDismissable=_ref$isKeyboardDismis===void 0?true:_ref$isKeyboardDismis,onRequestClose=_ref.onRequestClose;var _React$useState=_react.default.useState(!isOpen),_React$useState2=(0,_slicedToArray2.default)(_React$useState,2),exited=_React$useState2[0],setExited=_React$useState2[1];(0,_hooks.useKeyboardDismissable)({enabled:isOpen&&isKeyboardDismissable,callback:onRequestClose?onRequestClose:function(){}});if(exited&&!isOpen){return null;}if(_reactNative.Platform.OS==='android'&&useRNModalOnAndroid){return _react.default.createElement(_ExitAnimationContext.ExitAnimationContext.Provider,{value:{exited:exited,setExited:setExited},__self:this,__source:{fileName:_jsxFileName,lineNumber:38,columnNumber:7}},_react.default.createElement(_reactNative.Modal,{transparent:true,visible:true,onRequestClose:onRequestClose,__self:this,__source:{fileName:_jsxFileName,lineNumber:39,columnNumber:9}},children));}return _react.default.createElement(_overlays.OverlayContainer,{__self:this,__source:{fileName:_jsxFileName,lineNumber:48,columnNumber:5}},_react.default.createElement(_ExitAnimationContext.ExitAnimationContext.Provider,{value:{exited:exited,setExited:setExited},__self:this,__source:{fileName:_jsxFileName,lineNumber:49,columnNumber:7}},children));}
  //# sourceMappingURL=Overlay.js.map