Mailspring/internal_packages/sidebar-fullcontact/lib/sidebar-fullcontact.cjsx
Evan Morikawa 2e9a2ac167 feat(salesforce): new UI for Salesforce
Summary:
style opportunity picker and placeholder on tokenizing text fields

UI for synced opportunities

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1655
2015-06-17 20:40:08 -07:00

48 lines
1.3 KiB
CoffeeScript

_ = require 'underscore'
React = require "react"
FullContactStore = require "./fullcontact-store"
{InjectedComponentSet} = require 'nylas-component-kit'
SidebarFullContactDetails = require "./sidebar-fullcontact-details"
class SidebarFullContact extends React.Component
@displayName: "SidebarFullContact"
@containerStyles:
order: 1
maxWidth: 300
minWidth: 200
flexShrink: 0
constructor: (@props) ->
@state = @_getStateFromStores()
componentDidMount: =>
@unsubscribe = FullContactStore.listen @_onChange
componentWillUnmount: =>
@unsubscribe()
render: =>
<div className="full-contact-sidebar">
<SidebarFullContactDetails contact={@state.focusedContact ? {}}
fullContact={@_fullContact()}/>
<InjectedComponentSet matching={role: "sidebar:focusedContactInfo"}
direction="column"
exposedProps={focusedContact: @state.focusedContact}/>
</div>
_fullContact: =>
if @state.focusedContact?.thirdPartyData
return @state.focusedContact?.thirdPartyData["FullContact"] ? {}
else
return {}
_onChange: =>
@setState(@_getStateFromStores())
_getStateFromStores: =>
focusedContact: FullContactStore.focusedContact()
module.exports = SidebarFullContact