Mailspring/internal_packages/notifications/lib/main.es6
Halla Moore 9e3c3c14cd feat(sidebar-notifs) Create sidebar notifications to replace old bars
Summary:
Move the old bar notifications to the sidebar, and only display one notification
at a time using a priority-rating system. Remove all of the old notification
infrastructure.

Test Plan: Added specs, also reproduced notifications locally

Reviewers: bengotow

Reviewed By: bengotow

Subscribers: juan

Differential Revision: https://phab.nylas.com/D3310
2016-10-04 08:08:23 -07:00

45 lines
1.6 KiB
JavaScript

/* eslint no-unused-vars:0 */
import {ComponentRegistry, WorkspaceStore} from 'nylas-exports';
import ActivitySidebar from "./sidebar/activity-sidebar";
import TrialRemainingBlock from "./sidebar/trial-remaining-block";
import NotifWrapper from "./notif-wrapper";
import AccountErrorNotification from "./items/account-error-notif";
import DefaultClientNotification from "./items/default-client-notif";
import DevModeNotification from "./items/dev-mode-notif";
import DisabledMailRulesNotification from "./items/disabled-mail-rules-notif";
import OfflineNotification from "./items/offline-notification";
import UpdateNotification from "./items/update-notification";
const notifications = [
AccountErrorNotification,
DefaultClientNotification,
DevModeNotification,
DisabledMailRulesNotification,
OfflineNotification,
UpdateNotification,
]
export function activate() {
ComponentRegistry.register(ActivitySidebar, {location: WorkspaceStore.Location.RootSidebar});
ComponentRegistry.register(NotifWrapper, {location: WorkspaceStore.Location.RootSidebar});
ComponentRegistry.register(TrialRemainingBlock, {location: WorkspaceStore.Location.RootSidebar});
for (const notification of notifications) {
ComponentRegistry.register(notification, {role: 'RootSidebar:Notifications'});
}
}
export function serialize() {}
export function deactivate() {
ComponentRegistry.unregister(ActivitySidebar);
ComponentRegistry.unregister(TrialRemainingBlock);
ComponentRegistry.unregister(NotifWrapper);
for (const notification of notifications) {
ComponentRegistry.unregister(notification)
}
}