// @flow import React from 'react'; import * as ICONS from 'constants/icons'; import useBrowserNotifications from '$web/component/browserNotificationSettings/use-browser-notifications'; import 'scss/component/notifications-banner.scss'; import Icon from 'component/common/icon'; import Button from 'component/button'; import usePersistedState from 'effects/use-persisted-state'; export const BrowserNotificationBanner = () => { const { pushInitialized, pushSupported, pushEnabled, pushPermission, pushToggle, pushErrorModal, } = useBrowserNotifications(); const [hasAcknowledgedPush, setHasAcknowledgedPush] = usePersistedState('push-nag', false); if (!pushInitialized || !pushSupported || pushEnabled || pushPermission === 'denied' || hasAcknowledgedPush) { return null; } const handleClose = () => setHasAcknowledgedPush(true); return ( <>

{__('Realtime push notifications straight to your browser.')}
{__("Don't miss another notification again.")}

{pushErrorModal()} ); }; export default BrowserNotificationBanner;