mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-23 15:46:28 +08:00
Summary: re-display information on re-entry of thread Test Plan: edgehill --test Reviewers: bengotow Reviewed By: bengotow Differential Revision: https://review.inboxapp.com/D1340
39 lines
1,023 B
CoffeeScript
39 lines
1,023 B
CoffeeScript
_ = require 'underscore-plus'
|
|
React = require "react"
|
|
FullContactStore = require "./fullcontact-store"
|
|
|
|
SidebarFullContactDetails = require "./sidebar-fullcontact-details"
|
|
|
|
module.exports =
|
|
SidebarFullContact = React.createClass
|
|
|
|
getInitialState: ->
|
|
@_getStateFromStores()
|
|
|
|
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
|