Mailspring/internal_packages/thread-list/lib/main.cjsx
Ben Gotow 237bad59d8 feat(unread/spam): New items in the sidebar for unread and spam
Summary:
Adds a new unified "Spam" folder and a unified "Unread" view,
which shows all the messages in your inbox which are unread.

Test Plan: Run tests

Reviewers: evan, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D2901
2016-04-19 11:32:33 -07:00

69 lines
2.2 KiB
CoffeeScript

_ = require 'underscore'
React = require "react"
{ComponentRegistry, WorkspaceStore} = require "nylas-exports"
ThreadList = require './thread-list'
ThreadListToolbar = require './thread-list-toolbar'
MessageListToolbar = require './message-list-toolbar'
SelectedItemsStack = require './selected-items-stack'
{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