mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-12 20:44:30 +08:00
343e592569
Summary: Adds the draft list using a refactored list-tabular class. Also fixes several draft bugs that appeared after allowing editing. Test Plan: Run tests (need to test new ListTabular component ASAP) Reviewers: evan Reviewed By: evan Differential Revision: https://review.inboxapp.com/D1272
36 lines
No EOL
849 B
CoffeeScript
36 lines
No EOL
849 B
CoffeeScript
_ = require 'underscore-plus'
|
|
React = require "react"
|
|
{ComponentRegistry, WorkspaceStore} = require "inbox-exports"
|
|
ThreadList = require "./thread-list"
|
|
DraftList = require "./draft-list"
|
|
|
|
RootCenterComponent = React.createClass
|
|
displayName: 'RootCenterComponent'
|
|
|
|
getInitialState: ->
|
|
view: WorkspaceStore.selectedView()
|
|
|
|
componentDidMount: ->
|
|
@unsubscribe = WorkspaceStore.listen @_onStoreChange
|
|
|
|
componentWillUnmount: ->
|
|
@unsubscribe() if @unsubscribe
|
|
|
|
render: ->
|
|
views =
|
|
'threads': ThreadList
|
|
'drafts': DraftList
|
|
view = views[@state.view]
|
|
<view />
|
|
|
|
_onStoreChange: ->
|
|
@setState
|
|
view: WorkspaceStore.selectedView()
|
|
|
|
|
|
module.exports =
|
|
activate: (@state={}) ->
|
|
ComponentRegistry.register
|
|
view: RootCenterComponent
|
|
name: 'RootCenterComponent'
|
|
role: 'Root:Center' |