import * as React from 'react'; import { VisibleNotificationsContext } from './PopupNotificationProvider'; import NotificationItem from './NotificationItem'; import { useContext } from 'react'; import { _ } from '@joplin/lib/locale'; interface Props {} // This component displays the popups managed by PopupNotificationContext. // This allows popups to be shown in multiple windows at the same time. const PopupNotificationList: React.FC = () => { const popupSpecs = useContext(VisibleNotificationsContext); const popups = []; for (const spec of popupSpecs) { if (spec.dismissed) continue; popups.push( {spec.content()}, ); } popups.reverse(); if (popups.length) { return ; } else { return null; } }; export default PopupNotificationList;