mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-23 00:36:50 +08:00
564ecca8e0
Summary: add more Salesforce states more salesforce sidebar extract focused contacts into its own store fullcontact store fixes extract thread participants to own module typo Test Plan: edgehill --test Reviewers: bengotow Reviewed By: bengotow Differential Revision: https://review.inboxapp.com/D1326
41 lines
1 KiB
CoffeeScript
41 lines
1 KiB
CoffeeScript
_ = require 'underscore-plus'
|
|
React = require "react"
|
|
FullContactStore = require "./fullcontact-store"
|
|
|
|
SidebarFullContactDetails = require "./sidebar-fullcontact-details.cjsx"
|
|
|
|
module.exports =
|
|
SidebarFullContact = React.createClass
|
|
|
|
getInitialState: ->
|
|
fullContactCache: {}
|
|
focusedContact: null
|
|
|
|
componentDidMount: ->
|
|
@unsubscribe = FullContactStore.listen @_onChange
|
|
|
|
componentWillUnmount: ->
|
|
@unsubscribe()
|
|
|
|
render: ->
|
|
<div className="full-contact-sidebar">
|
|
<SidebarFullContactDetails contact={@state.focusedContact ? {}}
|
|
fullContact={@_fullContact()}/>
|
|
</div>
|
|
|
|
_fullContact: ->
|
|
if @state.focusedContact?.email
|
|
return @state.fullContactCache[@state.focusedContact.email] ? {}
|
|
else
|
|
return {}
|
|
|
|
_onChange: ->
|
|
@setState(@_getStateFromStores())
|
|
|
|
_getStateFromStores: ->
|
|
fullContactCache: FullContactStore.fullContactCache()
|
|
focusedContact: FullContactStore.focusedContact()
|
|
|
|
SidebarFullContact.maxWidth = 300
|
|
SidebarFullContact.minWidth = 200
|