_ = require 'underscore'
React = require "react"
{FocusedContactsStore} = require("nylas-exports")
{InjectedComponentSet} = require("nylas-component-kit")
class FocusedContactStorePropsContainer extends React.Component
@displayName: 'FocusedContactStorePropsContainer'
constructor: (@props) ->
@state = @_getStateFromStores()
componentDidMount: =>
@unsubscribe = FocusedContactsStore.listen(@_onChange)
componentWillUnmount: =>
@unsubscribe()
render: ->
classname = "sidebar-section"
if @state.focusedContact
classname += " visible"
inner = React.cloneElement(@props.children, @state)
{inner}
_onChange: =>
@setState(@_getStateFromStores())
_getStateFromStores: =>
sortedContacts: FocusedContactsStore.sortedContacts()
focusedContact: FocusedContactsStore.focusedContact()
focusedContactThreads: FocusedContactsStore.focusedContactThreads()
class SidebarPluginContainer extends React.Component
@displayName: 'SidebarPluginContainer'
@containerStyles:
order: 1
flexShrink: 0
minWidth:200
maxWidth:300
constructor: (@props) ->
render: ->
class SidebarPluginContainerInner extends React.Component
constructor: (@props) ->
render: ->
module.exports = SidebarPluginContainer