UNPKG

@magicbell/magicbell-react

Version:

React components for building a notification inbox for your app

17 lines 748 B
import { path, pathOr } from 'ramda'; import React from 'react'; /** * Component that renders the web push subscription page in an invisible iframe * to refresh the user's subscription. * * @example * <WebPushRefresh config={configStore} /> */ export default function WebPushRefresh({ config }) { const isWebPushEnabled = pathOr(false, ['webPush', 'enabled'], config.channels); const subscribeUrl = path(['webPush', 'config', 'subscribeUrl'], config.channels); if (!isWebPushEnabled) return null; return (React.createElement("iframe", { title: "Web push subscriptions", src: subscribeUrl, height: "0", width: "0", tabIndex: -1, style: { display: 'none' }, hidden: true })); } //# sourceMappingURL=WebPushRefresh.js.map