Mailspring/internal_packages/thread-list/lib/main.cjsx
dillon fc770a85cd feat(toggle-unread): threads can now toggle their unread status. fixes T3483.
Summary:
still WIP, but functionality is there.

TODO:
[x] write tests
[x] swap out the current markasread icon for the correct markasread icon that @sdw is making
[x] figure out how to address this point by @bengotow: https://phab.nylas.com/D2024?id=19139#inline-12168

Test Plan: tested manually. still need to write tests though.

Reviewers: evan, bengotow

Reviewed By: bengotow

Subscribers: sdw

Maniphest Tasks: T3483

Differential Revision: https://phab.nylas.com/D2024
2015-09-15 16:49:16 -07:00

61 lines
2.1 KiB
CoffeeScript

_ = require 'underscore'
React = require "react"
{ComponentRegistry, WorkspaceStore} = require "nylas-exports"
{DownButton, UpButton, ThreadBulkArchiveButton, ThreadBulkStarButton, ThreadBulkToggleUnreadButton} = require "./thread-buttons"
{DraftDeleteButton} = require "./draft-buttons"
ThreadSelectionBar = require './thread-selection-bar'
ThreadList = require './thread-list'
DraftListSidebarItem = require './draft-list-sidebar-item'
DraftSelectionBar = require './draft-selection-bar'
DraftList = require './draft-list'
module.exports =
activate: (@state={}) ->
WorkspaceStore.defineSheet 'Drafts', {root: true, name: 'Drafts', sidebarComponent: DraftListSidebarItem},
list: ['RootSidebar', 'DraftList']
ComponentRegistry.register ThreadList,
location: WorkspaceStore.Location.ThreadList
ComponentRegistry.register ThreadSelectionBar,
location: WorkspaceStore.Location.ThreadList.Toolbar
ComponentRegistry.register DraftList,
location: WorkspaceStore.Location.DraftList
ComponentRegistry.register DraftSelectionBar,
location: WorkspaceStore.Location.DraftList.Toolbar
ComponentRegistry.register DownButton,
location: WorkspaceStore.Sheet.Thread.Toolbar.Right
modes: ['list']
ComponentRegistry.register UpButton,
location: WorkspaceStore.Sheet.Thread.Toolbar.Right
modes: ['list']
ComponentRegistry.register ThreadBulkArchiveButton,
role: 'thread:BulkAction'
ComponentRegistry.register ThreadBulkStarButton,
role: 'thread:BulkAction'
ComponentRegistry.register ThreadBulkToggleUnreadButton,
role: 'thread:BulkAction'
ComponentRegistry.register DraftDeleteButton,
role: 'draft:BulkAction'
deactivate: ->
ComponentRegistry.unregister DraftList
ComponentRegistry.unregister DraftSelectionBar
ComponentRegistry.unregister ThreadList
ComponentRegistry.unregister ThreadSelectionBar
ComponentRegistry.unregister ThreadBulkArchiveButton
ComponentRegistry.unregister ThreadBulkToggleUnreadButton
ComponentRegistry.unregister DownButton
ComponentRegistry.unregister UpButton
ComponentRegistry.unregister DraftDeleteButton