UNPKG

react-popup-manager

Version:

Manage react popups, Modals, Lightboxes, Notifications, etc. easily

39 lines 1.84 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.PopupProvider = void 0; var React = require("react"); var PopupsWrapper_1 = require("./PopupsWrapper"); var PopupContext_1 = require("./PopupContext"); var popupManager_1 = require("./popupManager"); var PopupProvider = /** @class */ (function (_super) { __extends(PopupProvider, _super); function PopupProvider(props, context) { var _this = _super.call(this, props, context) || this; _this.popupManager = props.popupManager || new popupManager_1.PopupManager(); return _this; } PopupProvider.prototype.render = function () { var children = this.props.children; return (React.createElement(PopupContext_1.PopupContext.Provider, { value: { popupManager: this.popupManager } }, React.createElement(PopupsWrapper_1.PopupsWrapper, { popupManager: this.popupManager }), children)); }; return PopupProvider; }(React.Component)); exports.PopupProvider = PopupProvider; //# sourceMappingURL=PopupProvider.js.map