UNPKG

sws-frontend

Version:

sws frontend project

42 lines 1.65 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var React = require("react"); var NotificationSystem = require("react-notification-system"); require("./notifier.scss"); var Notifier = (function (_super) { __extends(Notifier, _super); function Notifier(p) { var _this = _super.call(this, p) || this; _this.notificationSystem = null; return _this; } Notifier.prototype.componentDidMount = function () { this.notificationSystem = this.refs.notificationSystem; }; Notifier.prototype.componentWillReceiveProps = function (np) { var _this = this; np.notifications && np.notifications.forEach(function (n) { return _this.notificationSystem.addNotification(n); }); }; // componentWillUnmount() { // this.notificationSystem.clearNotifications(); // } Notifier.prototype.render = function () { return React.createElement(NotificationSystem, { ref: "notificationSystem" }); }; return Notifier; }(React.Component)); exports.Notifier = Notifier; exports.default = Notifier; //# sourceMappingURL=notifier.js.map