Mailspring/examples/N1-Composer-Templates/lib/main.es6
Juan Tejada 647aed5f14 Convert Composer Template example to ES6
Summary:
- Include ES6 files in spec-suite
- Fix template store specs
- Refactors TemplateStore a little bit to adjust to specs
- Convert coffe .cjsx files to ES6 .jsx files
- Fix TemplateDraftStoreExtension functions
- Update ComposerTemplates example README

Test Plan: - Plugin unit tests

Reviewers: bengotow, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2250
2015-11-14 22:12:06 -08:00

23 lines
792 B
JavaScript

import {ComponentRegistry, DraftStore} from 'nylas-exports';
import TemplatePicker from './template-picker';
import TemplateStatusBar from './template-status-bar';
import Extension from './template-draft-extension';
module.exports = {
item: null, // The DOM item the main React component renders into
activate(state = {}) {
this.state = state;
ComponentRegistry.register(TemplatePicker, {role: 'Composer:ActionButton'});
ComponentRegistry.register(TemplateStatusBar, {role: 'Composer:Footer'});
return DraftStore.registerExtension(Extension);
},
deactivate() {
ComponentRegistry.unregister(TemplatePicker);
ComponentRegistry.unregister(TemplateStatusBar);
return DraftStore.unregisterExtension(Extension);
},
serialize() { return this.state; },
};