🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

react-native-app-notification

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-app-notification - npm Package Compare versions

Comparing version
1.5.1
to
1.5.2
+1
-1
dist/AppNotification.js

@@ -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;
{
"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": {