mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-12 04:25:31 +08:00
886328ff7a
Great breakdown of React changes here: https://github.com/facebook/react/blob/master/CHANGELOG.md#0140-october-7-2015 Due to deprecation warnings, I don't think this will break third-party extensions unless they were doing really bad things.
37 lines
943 B
CoffeeScript
37 lines
943 B
CoffeeScript
_ = require 'underscore'
|
|
React = require "react"
|
|
ReactCSSTransitionGroup = require 'react-addons-css-transition-group'
|
|
FullContactStore = require "./fullcontact-store"
|
|
|
|
{InjectedComponentSet} = require 'nylas-component-kit'
|
|
|
|
SidebarFullContactDetails = require "./sidebar-fullcontact-details"
|
|
|
|
class SidebarFullContact extends React.Component
|
|
@displayName: "SidebarFullContact"
|
|
|
|
@propTypes:
|
|
contact: React.PropTypes.object
|
|
|
|
constructor: (@props) ->
|
|
@state = @_getStateFromStores()
|
|
|
|
componentDidMount: =>
|
|
@unsubscribe = FullContactStore.listen(@_onChange)
|
|
|
|
componentWillUnmount: =>
|
|
@unsubscribe()
|
|
|
|
render: =>
|
|
<SidebarFullContactDetails
|
|
contact={@props.contact}
|
|
fullContactData={@state.focusedContactData} />
|
|
|
|
_onChange: =>
|
|
@setState(@_getStateFromStores())
|
|
|
|
_getStateFromStores: =>
|
|
focusedContactData: FullContactStore.dataForContact(@props.contact)
|
|
|
|
|
|
module.exports = SidebarFullContact
|