@devvie/bottom-sheet
Version:
The 😎smart , 📦tiny , and 🎗flexible bottom sheet your app craves 🚀
35 lines • 1.42 kB
JavaScript
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import React from 'react';
import { Animated, Pressable, StyleSheet } from 'react-native';
/**
* Polymorphic and re-usable animated backdrop mask component
*/
const _AnimatedTouchableBackdropMask = Animated.createAnimatedComponent(Pressable);
const AnimatedTouchableBackdropMask = _ref => {
let {
style,
isPressable,
pressHandler,
android_touchRippleColor,
...otherProps
} = _ref;
return isPressable ? /*#__PURE__*/React.createElement(_AnimatedTouchableBackdropMask, _extends({
style: [style, styles.sharedBackdropStyle],
android_ripple: android_touchRippleColor ? {
borderless: true,
color: android_touchRippleColor,
foreground: true
} : undefined,
onPress: pressHandler
}, otherProps)) :
/*#__PURE__*/
// @ts-expect-error
React.createElement(Animated.View, _extends({
style: [style, styles.sharedBackdropStyle]
}, otherProps));
};
const styles = StyleSheet.create({
sharedBackdropStyle: StyleSheet.absoluteFillObject
});
export default AnimatedTouchableBackdropMask;
//# sourceMappingURL=index.js.map