UNPKG

@magicbell/magicbell-react

Version:

React components for building a notification inbox for your app

21 lines 942 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = WebPushRefresh; const tslib_1 = require("tslib"); const ramda_1 = require("ramda"); const react_1 = tslib_1.__importDefault(require("react")); /** * Component that renders the web push subscription page in an invisible iframe * to refresh the user's subscription. * * @example * <WebPushRefresh config={configStore} /> */ function WebPushRefresh({ config }) { const isWebPushEnabled = (0, ramda_1.pathOr)(false, ['webPush', 'enabled'], config.channels); const subscribeUrl = (0, ramda_1.path)(['webPush', 'config', 'subscribeUrl'], config.channels); if (!isWebPushEnabled) return null; return (react_1.default.createElement("iframe", { title: "Web push subscriptions", src: subscribeUrl, height: "0", width: "0", tabIndex: -1, style: { display: 'none' }, hidden: true })); } //# sourceMappingURL=WebPushRefresh.js.map