mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-01 05:06:53 +08:00
fix(thread-list): Add missing displayName, ES6
This commit is contained in:
parent
a5e3bf86c2
commit
35d5f29b82
3 changed files with 82 additions and 70 deletions
|
@ -1,69 +0,0 @@
|
|||
_ = require 'underscore'
|
||||
React = require "react"
|
||||
{ComponentRegistry, WorkspaceStore} = require "nylas-exports"
|
||||
|
||||
ThreadList = require './thread-list'
|
||||
ThreadListToolbar = require('./thread-list-toolbar').default
|
||||
MessageListToolbar = require('./message-list-toolbar').default
|
||||
SelectedItemsStack = require('./selected-items-stack').default
|
||||
|
||||
{UpButton,
|
||||
DownButton,
|
||||
TrashButton,
|
||||
ArchiveButton,
|
||||
MarkAsSpamButton,
|
||||
ToggleUnreadButton,
|
||||
ToggleStarredButton} = require "./thread-toolbar-buttons"
|
||||
|
||||
module.exports =
|
||||
activate: (@state={}) ->
|
||||
ComponentRegistry.register ThreadList,
|
||||
location: WorkspaceStore.Location.ThreadList
|
||||
|
||||
ComponentRegistry.register SelectedItemsStack,
|
||||
location: WorkspaceStore.Location.MessageList
|
||||
modes: ['split']
|
||||
|
||||
# Toolbars
|
||||
ComponentRegistry.register ThreadListToolbar,
|
||||
location: WorkspaceStore.Location.ThreadList.Toolbar
|
||||
modes: ['list']
|
||||
|
||||
ComponentRegistry.register MessageListToolbar,
|
||||
location: WorkspaceStore.Location.MessageList.Toolbar
|
||||
|
||||
ComponentRegistry.register DownButton,
|
||||
location: WorkspaceStore.Location.MessageList.Toolbar
|
||||
modes: ['list']
|
||||
|
||||
ComponentRegistry.register UpButton,
|
||||
location: WorkspaceStore.Location.MessageList.Toolbar
|
||||
modes: ['list']
|
||||
|
||||
ComponentRegistry.register ArchiveButton,
|
||||
role: 'ThreadActionsToolbarButton'
|
||||
|
||||
ComponentRegistry.register TrashButton,
|
||||
role: 'ThreadActionsToolbarButton'
|
||||
|
||||
ComponentRegistry.register MarkAsSpamButton,
|
||||
role: 'ThreadActionsToolbarButton'
|
||||
|
||||
ComponentRegistry.register ToggleStarredButton,
|
||||
role: 'ThreadActionsToolbarButton'
|
||||
|
||||
ComponentRegistry.register ToggleUnreadButton,
|
||||
role: 'ThreadActionsToolbarButton'
|
||||
|
||||
deactivate: ->
|
||||
ComponentRegistry.unregister ThreadList
|
||||
ComponentRegistry.unregister SelectedItemsStack
|
||||
ComponentRegistry.unregister ThreadListToolbar
|
||||
ComponentRegistry.unregister MessageListToolbar
|
||||
ComponentRegistry.unregister ArchiveButton
|
||||
ComponentRegistry.unregister TrashButton
|
||||
ComponentRegistry.unregister MarkAsSpamButton
|
||||
ComponentRegistry.unregister ToggleUnreadButton
|
||||
ComponentRegistry.unregister ToggleStarredButton
|
||||
ComponentRegistry.unregister UpButton
|
||||
ComponentRegistry.unregister DownButton
|
81
internal_packages/thread-list/lib/main.es6
Normal file
81
internal_packages/thread-list/lib/main.es6
Normal file
|
@ -0,0 +1,81 @@
|
|||
import {ComponentRegistry, WorkspaceStore} from "nylas-exports";
|
||||
|
||||
import ThreadList from './thread-list';
|
||||
import ThreadListToolbar from './thread-list-toolbar';
|
||||
import MessageListToolbar from './message-list-toolbar';
|
||||
import SelectedItemsStack from './selected-items-stack';
|
||||
|
||||
import {
|
||||
UpButton,
|
||||
DownButton,
|
||||
TrashButton,
|
||||
ArchiveButton,
|
||||
MarkAsSpamButton,
|
||||
ToggleUnreadButton,
|
||||
ToggleStarredButton,
|
||||
} from "./thread-toolbar-buttons";
|
||||
|
||||
export function activate() {
|
||||
ComponentRegistry.register(ThreadList, {
|
||||
location: WorkspaceStore.Location.ThreadList,
|
||||
});
|
||||
|
||||
ComponentRegistry.register(SelectedItemsStack, {
|
||||
location: WorkspaceStore.Location.MessageList,
|
||||
modes: ['split'],
|
||||
});
|
||||
|
||||
// Toolbars
|
||||
ComponentRegistry.register(ThreadListToolbar, {
|
||||
location: WorkspaceStore.Location.ThreadList.Toolbar,
|
||||
modes: ['list'],
|
||||
});
|
||||
|
||||
ComponentRegistry.register(MessageListToolbar, {
|
||||
location: WorkspaceStore.Location.MessageList.Toolbar,
|
||||
});
|
||||
|
||||
ComponentRegistry.register(DownButton, {
|
||||
location: WorkspaceStore.Location.MessageList.Toolbar,
|
||||
modes: ['list'],
|
||||
});
|
||||
|
||||
ComponentRegistry.register(UpButton, {
|
||||
location: WorkspaceStore.Location.MessageList.Toolbar,
|
||||
modes: ['list'],
|
||||
});
|
||||
|
||||
ComponentRegistry.register(ArchiveButton, {
|
||||
role: 'ThreadActionsToolbarButton',
|
||||
});
|
||||
|
||||
ComponentRegistry.register(TrashButton, {
|
||||
role: 'ThreadActionsToolbarButton',
|
||||
});
|
||||
|
||||
ComponentRegistry.register(MarkAsSpamButton, {
|
||||
role: 'ThreadActionsToolbarButton',
|
||||
});
|
||||
|
||||
ComponentRegistry.register(ToggleStarredButton, {
|
||||
role: 'ThreadActionsToolbarButton',
|
||||
});
|
||||
|
||||
ComponentRegistry.register(ToggleUnreadButton, {
|
||||
role: 'ThreadActionsToolbarButton',
|
||||
});
|
||||
}
|
||||
|
||||
export function deactivate() {
|
||||
ComponentRegistry.unregister(ThreadList);
|
||||
ComponentRegistry.unregister(SelectedItemsStack);
|
||||
ComponentRegistry.unregister(ThreadListToolbar);
|
||||
ComponentRegistry.unregister(MessageListToolbar);
|
||||
ComponentRegistry.unregister(ArchiveButton);
|
||||
ComponentRegistry.unregister(TrashButton);
|
||||
ComponentRegistry.unregister(MarkAsSpamButton);
|
||||
ComponentRegistry.unregister(ToggleUnreadButton);
|
||||
ComponentRegistry.unregister(ToggleStarredButton);
|
||||
ComponentRegistry.unregister(UpButton);
|
||||
ComponentRegistry.unregister(DownButton);
|
||||
}
|
|
@ -36,7 +36,7 @@ const MessageListToolbar = ({items, injectedButtons}) => {
|
|||
</ReactCSSTransitionGroup>
|
||||
)
|
||||
}
|
||||
|
||||
MessageListToolbar.displayName = 'MessageListToolbar';
|
||||
MessageListToolbar.propTypes = {
|
||||
items: PropTypes.array,
|
||||
injectedButtons: PropTypes.element,
|
||||
|
|
Loading…
Reference in a new issue