mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-12 20:44:30 +08:00
2e9a2ac167
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
48 lines
1.3 KiB
CoffeeScript
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
|