react-native-app-notification
Advanced tools
@@ -98,3 +98,3 @@ "use strict"; | ||
| }; | ||
| _this.renderNotification = function (notification) { return (react_1.default.createElement(AppNotificationWrapper_1.default, __assign({ key: notification.id }, _this.props, notification), _this.props.renderNotification ? (_this.props.renderNotification(notification)) : (react_1.default.createElement(AppNotificationUI_1.default, __assign({}, _this.props, notification))))); }; | ||
| _this.renderNotification = function (notification) { return (react_1.default.createElement(AppNotificationWrapper_1.default, __assign({ key: notification.id }, _this.props, notification), _this.props.renderNotification ? (_this.props.renderNotification(notification)) : (react_1.default.createElement(AppNotificationUI_1.default, __assign({}, _this.props, notification, { onPress: notification.panEnabled ? undefined : notification.onPress }))))); }; | ||
| AppNotification.ref = _this; | ||
@@ -101,0 +101,0 @@ return _this; |
@@ -8,8 +8,8 @@ "use strict"; | ||
| var react_1 = __importDefault(require("react")); | ||
| var styled_native_kit_1 = require("styled-native-kit"); | ||
| var react_native_1 = require("react-native"); | ||
| var styled_1 = require("./styled"); | ||
| exports.AppNotificationUI = function (_a) { | ||
| var title = _a.title, message = _a.message, imageUrl = _a.imageUrl, onPress = _a.onPress, containerStyle = _a.containerStyle, imageStyle = _a.imageStyle, messageStyle = _a.messageStyle, titleStyle = _a.titleStyle, left = _a.left, right = _a.right; | ||
| return (react_1.default.createElement(styled_1.Card, { style: containerStyle, activeOpacity: onPress ? 0.7 : 1, onPress: onPress }, | ||
| react_1.default.createElement(styled_native_kit_1.FlexRow, { style: { alignItems: 'center', justifyContent: 'center' } }, | ||
| var title = _a.title, message = _a.message, imageUrl = _a.imageUrl, onPress = _a.onPress, panEnabled = _a.panEnabled, containerStyle = _a.containerStyle, imageStyle = _a.imageStyle, messageStyle = _a.messageStyle, titleStyle = _a.titleStyle, left = _a.left, right = _a.right; | ||
| return (react_1.default.createElement(styled_1.Card, { style: containerStyle, activeOpacity: onPress || panEnabled ? 0.7 : 1, onPress: onPress }, | ||
| react_1.default.createElement(react_native_1.View, { style: { alignItems: 'center', justifyContent: 'center', flexDirection: 'row' } }, | ||
| left && react_1.default.createElement(styled_1.LeftContainer, null, left), | ||
@@ -16,0 +16,0 @@ imageUrl && react_1.default.createElement(styled_1.BaseImage, { source: { uri: imageUrl }, style: imageStyle }), |
@@ -39,3 +39,2 @@ "use strict"; | ||
| var react_native_1 = require("react-native"); | ||
| var styled_native_kit_1 = require("styled-native-kit"); | ||
| var useAnimatedValue_1 = __importDefault(require("../hooks/useAnimatedValue")); | ||
@@ -45,3 +44,3 @@ var useLayout_1 = __importDefault(require("../hooks/useLayout")); | ||
| exports.AppNotificationWrapper = function (_a) { | ||
| var animateOut = _a.animateOut, _b = _a.animated, animated = _b === void 0 ? true : _b, _c = _a.panEnabled, panEnabled = _c === void 0 ? true : _c, alignBottom = _a.alignBottom, children = _a.children, _d = _a.animationWrappers, animationWrappers = _d === void 0 ? { in: undefined, out: undefined } : _d; | ||
| var animateOut = _a.animateOut, _b = _a.animated, animated = _b === void 0 ? true : _b, _c = _a.panEnabled, panEnabled = _c === void 0 ? true : _c, onPress = _a.onPress, alignBottom = _a.alignBottom, children = _a.children, _d = _a.animationWrappers, animationWrappers = _d === void 0 ? { in: undefined, out: undefined } : _d; | ||
| var _e = react_1.useState(false), hide = _e[0], setHide = _e[1]; | ||
@@ -56,5 +55,8 @@ var _f = useLayout_1.default(), layout = _f[0], bindLayout = _f[1]; | ||
| }, | ||
| onPanResponderStart: function (e, _a) { }, | ||
| onPanResponderRelease: function (e, _a) { | ||
| var vx = _a.vx, dx = _a.dx; | ||
| var screenWidth = react_native_1.Dimensions.get('window').width; | ||
| if (Math.abs(dx) < 0.1 * screenWidth) | ||
| onPress === null || onPress === void 0 ? void 0 : onPress(); | ||
| if (Math.abs(vx) >= 0.5 || Math.abs(dx) >= 0.5 * screenWidth) { | ||
@@ -78,3 +80,3 @@ react_native_1.Animated.timing(translateX, { | ||
| var panWrapperProps = {}; | ||
| var AnimationWrapper = styled_native_kit_1.View; | ||
| var AnimationWrapper = react_native_1.View; | ||
| var wrapperProps = {}; | ||
@@ -99,4 +101,4 @@ if (animated) { | ||
| react_1.default.createElement(PanWrapper, __assign({}, panWrapperProps), | ||
| react_1.default.createElement(styled_native_kit_1.View, __assign({}, bindLayout), children)))); | ||
| react_1.default.createElement(react_native_1.View, __assign({}, bindLayout), children)))); | ||
| }; | ||
| exports.default = exports.AppNotificationWrapper; |
+2
-3
| { | ||
| "name": "react-native-app-notification", | ||
| "version": "1.5.1", | ||
| "version": "1.5.2", | ||
| "description": "In-app custom notifications for React-Native", | ||
@@ -29,4 +29,3 @@ "main": "dist/index.js", | ||
| "dependencies": { | ||
| "styled-components": "*", | ||
| "styled-native-kit": "*" | ||
| "styled-components": "*" | ||
| }, | ||
@@ -33,0 +32,0 @@ "devDependencies": { |
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
40319
0.56%3
-25%740
0.41%2
-33.33%+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed