Skip to content

Instantly share code, notes, and snippets.

@CryogenicPlanet
Created February 14, 2021 00:26
Show Gist options
  • Save CryogenicPlanet/bdfc89af0a042c35576c4b0b984aaaa7 to your computer and use it in GitHub Desktop.
Save CryogenicPlanet/bdfc89af0a042c35576c4b0b984aaaa7 to your computer and use it in GitHub Desktop.
react-push-notification patch
diff --git a/node_modules/react-push-notification/dist/notifications/Notifications.js b/node_modules/react-push-notification/dist/notifications/Notifications.js
index 0f14e14..c4dbf28 100644
--- a/node_modules/react-push-notification/dist/notifications/Notifications.js
+++ b/node_modules/react-push-notification/dist/notifications/Notifications.js
@@ -1,12 +1,13 @@
-"use strict";
-var __importDefault = (this && this.__importDefault) || function (mod) {
- return (mod && mod.__esModule) ? mod : { "default": mod };
-};
-Object.defineProperty(exports, "__esModule", { value: true });
-const react_1 = __importDefault(require("react"));
-const Storage_1 = __importDefault(require("./Storage"));
-require("./Notification.css");
-const PushNotification_1 = __importDefault(require("./PushNotification"));
+
+const __importDefault =
+ (this && this.__importDefault) ||
+ function (mod) {
+ return mod && mod.__esModule ? mod : { default: mod }
+ }
+Object.defineProperty(exports, '__esModule', { value: true })
+const react_1 = __importDefault(require('react'))
+const Storage_1 = __importDefault(require('./Storage'))
+const PushNotification_1 = __importDefault(require('./PushNotification'))
/**
* Notification injector, which renders
* the push notifications rendered
@@ -18,22 +19,40 @@ const PushNotification_1 = __importDefault(require("./PushNotification"));
*
*/
class Notifications extends react_1.default.Component {
- constructor() {
- super(...arguments);
- this.state = {
- value: [],
- };
- }
- componentDidMount() {
- Storage_1.default.addListener((v) => this.setState({ value: v }));
- }
- render() {
- const { position } = this.props;
- const classN = `rpn-notification-holder ${position || 'top-middle'} supertest`;
- return react_1.default.createElement("div", { className: classN }, this.state.value.map((note, i) => {
- return react_1.default.createElement(PushNotification_1.default, { key: i, closeNotification: Storage_1.default.popAndPush, onClick: note.onClick, id: note.id, theme: note.theme, title: note.title, subtitle: note.subtitle, closeButton: note.closeButton, message: note.message, styling: note.styling });
- }));
+ constructor() {
+ super(...arguments)
+ this.state = {
+ value: []
}
+ }
+
+ componentDidMount() {
+ Storage_1.default.addListener(v => this.setState({ value: v }))
+ }
+
+ render() {
+ const { position } = this.props
+ const classN = `rpn-notification-holder ${
+ position || 'top-middle'
+ } supertest`
+ return react_1.default.createElement(
+ 'div',
+ { className: classN },
+ this.state.value.map((note, i) => {
+ return react_1.default.createElement(PushNotification_1.default, {
+ key: i,
+ closeNotification: Storage_1.default.popAndPush,
+ onClick: note.onClick,
+ id: note.id,
+ theme: note.theme,
+ title: note.title,
+ subtitle: note.subtitle,
+ closeButton: note.closeButton,
+ message: note.message,
+ styling: note.styling
+ })
+ })
+ )
+ }
}
-;
-exports.default = Notifications;
+exports.default = Notifications
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment