UNPKG

@devvie/bottom-sheet

Version:

The 😎smart , 📦tiny , and 🎗flexible bottom sheet your app craves 🚀

54 lines (53 loc) • 1.83 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _reactNative = require("react-native"); var _typesD = require("../../types.d.js"); var _index = _interopRequireDefault(require("../animatedTouchableBackdropMask/index.js")); var _jsxRuntime = require("react/jsx-runtime"); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } /** * Abstracted, polymorphic backdrop that handles custom and default backdrop */ const Backdrop = ({ BackdropComponent, backdropPosition = _typesD.CUSTOM_BACKDROP_POSITIONS.BEHIND, sheetOpen, containerHeight, contentContainerHeight, _animatedHeight, closeOnPress, rippleColor, pressHandler, animatedBackdropOpacity, backdropColor }) => { const heightStyle = sheetOpen ? containerHeight - contentContainerHeight : 0; return BackdropComponent ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, { style: backdropPosition === _typesD.CUSTOM_BACKDROP_POSITIONS.BEHIND ? _reactNative.StyleSheet.absoluteFillObject : { height: heightStyle }, children: /*#__PURE__*/(0, _jsxRuntime.jsx)(BackdropComponent, { _animatedHeight: _animatedHeight }) }) : closeOnPress ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.default, { isPressable: true, android_touchRippleColor: rippleColor, pressHandler: pressHandler, style: { opacity: animatedBackdropOpacity, backgroundColor: backdropColor }, touchSoundDisabled: true }, 'TouchableBackdropMask') : /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.default, { isPressable: false, style: { opacity: animatedBackdropOpacity, backgroundColor: backdropColor } }, 'TouchableBackdropMask'); }; var _default = exports.default = Backdrop; //# sourceMappingURL=index.js.map