Mailspring/internal_packages/sidebar-fullcontact/lib/sidebar-fullcontact.cjsx
Ben Gotow 886328ff7a bump(react): 0.13.2 => 0.14.7
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.
2016-03-29 01:43:12 -07:00

38 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