UNPKG

stream-chat-react-native-core

Version:

The official React Native and Expo components for Stream Chat, a service for building chat applications

56 lines 2.49 kB
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.ClippingFadeBottom = void 0; var _react = _interopRequireDefault(require("react")); var _reactNative = require("react-native"); var _reactNativeSvg = _interopRequireWildcard(require("react-native-svg")); var _jsxRuntime = require("react/jsx-runtime"); var _jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/components/UIComponents/ClippingFadeBottom.tsx"; function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); } var CLIPPING_FADE_HEIGHT = 16; var CLIPPING_FADE_GRADIENT_ID = 'sdk-clipping-fade-bottom'; var ClippingFadeBottom = ({ backgroundColor }) => (0, _jsxRuntime.jsx)(_reactNative.View, { pointerEvents: "none", style: styles.fade, children: (0, _jsxRuntime.jsxs)(_reactNativeSvg.default, { height: "100%", width: "100%", children: [(0, _jsxRuntime.jsx)(_reactNativeSvg.Defs, { children: (0, _jsxRuntime.jsxs)(_reactNativeSvg.LinearGradient, { id: CLIPPING_FADE_GRADIENT_ID, x1: "0", x2: "0", y1: "0", y2: "1", children: [(0, _jsxRuntime.jsx)(_reactNativeSvg.Stop, { offset: "0", stopColor: backgroundColor, stopOpacity: "0" }), (0, _jsxRuntime.jsx)(_reactNativeSvg.Stop, { offset: "1", stopColor: backgroundColor, stopOpacity: "1" })] }) }), (0, _jsxRuntime.jsx)(_reactNativeSvg.Rect, { fill: `url(#${CLIPPING_FADE_GRADIENT_ID})`, height: "100%", width: "100%" })] }) }); exports.ClippingFadeBottom = ClippingFadeBottom; var styles = _reactNative.StyleSheet.create({ fade: { bottom: 0, height: CLIPPING_FADE_HEIGHT, left: 0, position: 'absolute', right: 0 } }); //# sourceMappingURL=ClippingFadeBottom.js.map