React = require 'react' {Actions} = require("nylas-exports") SidebarDividerItem = require("./account-sidebar-divider-item") SidebarTagItem = require("./account-sidebar-tag-item") SidebarSheetItem = require("./account-sidebar-sheet-item") SidebarStore = require ("./account-sidebar-store") class AccountSidebar extends React.Component @displayName: 'AccountSidebar' @containerRequired: false @containerStyles: minWidth: 165 maxWidth: 190 constructor: (@props) -> @state = @_getStateFromStores() componentDidMount: => @unsubscribe = SidebarStore.listen @_onStoreChange # It's important that every React class explicitly stops listening to # atom events before it unmounts. Thank you event-kit # This can be fixed via a Reflux mixin componentWillUnmount: => @unsubscribe() if @unsubscribe render: =>
_sections: => return @state.sections.map (section) =>