2015-12-05 14:09:25 +08:00
|
|
|
import {PreferencesUIStore, ComponentRegistry, ExtensionRegistry} from 'nylas-exports';
|
2015-11-12 04:49:48 +08:00
|
|
|
import TemplatePicker from './template-picker';
|
|
|
|
import TemplateStatusBar from './template-status-bar';
|
2015-12-05 14:09:25 +08:00
|
|
|
import TemplateComposerExtension from './template-composer-extension';
|
2015-11-12 04:49:48 +08:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
activate(state = {}) {
|
|
|
|
this.state = state;
|
2015-12-03 13:28:13 +08:00
|
|
|
this.preferencesTab = new PreferencesUIStore.TabItem({
|
2015-12-05 14:09:25 +08:00
|
|
|
tabId: 'Quick Replies',
|
|
|
|
displayName: 'Quick Replies',
|
|
|
|
component: require('./preferences-templates'),
|
2015-12-03 13:28:13 +08:00
|
|
|
});
|
2015-11-12 04:49:48 +08:00
|
|
|
ComponentRegistry.register(TemplatePicker, {role: 'Composer:ActionButton'});
|
|
|
|
ComponentRegistry.register(TemplateStatusBar, {role: 'Composer:Footer'});
|
2015-12-03 13:28:13 +08:00
|
|
|
PreferencesUIStore.registerPreferencesTab(this.preferencesTab);
|
2015-12-05 14:09:25 +08:00
|
|
|
ExtensionRegistry.Composer.register(TemplateComposerExtension);
|
2015-11-12 04:49:48 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
deactivate() {
|
|
|
|
ComponentRegistry.unregister(TemplatePicker);
|
|
|
|
ComponentRegistry.unregister(TemplateStatusBar);
|
2015-12-03 13:28:13 +08:00
|
|
|
PreferencesUIStore.unregisterPreferencesTab(this.preferencesTab.sectionId);
|
2015-12-05 14:09:25 +08:00
|
|
|
ExtensionRegistry.Composer.unregister(TemplateComposerExtension);
|
2015-11-12 04:49:48 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
serialize() { return this.state; },
|
|
|
|
};
|