Mailspring/internal_packages/thread-list/lib/main.cjsx
Juan Tejada 687597134d feat(selection): Add new display for selection count + update toolbar
Summary:
- New behavior is that the in split mode, you will perform actions on
  the selection via the MessageListToolbar (the toolbar positioned above
  the message list)
- Refactored and moved around a bunch of code to achieve this:
  - Mostly renaming stuff and moving stuff around and removing some
    duplication
  - Update naming of toolbar role to a single role, and update relevant code
  - Converted and refactored a bunch of code into ES6, specifically to reuse the code for the ThreadActionsToolbar at the 2 locations
  - Deprecated MultiselectActionBar in favor of MultiselectToolbar
  - Deprecated old roles
- Punted the animation for the stackable cards in the selection display for now.
- #370

Test Plan: - Manual and unit tests

Reviewers: evan, drew, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2756
2016-03-21 12:20:11 -07:00

64 lines
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,
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 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 ToggleUnreadButton
ComponentRegistry.unregister ToggleStarredButton
ComponentRegistry.unregister UpButton
ComponentRegistry.unregister DownButton