mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-15 06:06:35 +08:00
23 lines
568 B
Text
23 lines
568 B
Text
|
React = require "react"
|
||
|
AccountSidebar = require "./account-sidebar"
|
||
|
|
||
|
module.exports =
|
||
|
item: null # The DOM item the main React component renders into
|
||
|
|
||
|
activate: (@state) ->
|
||
|
unless @item?
|
||
|
@item = document.createElement("div")
|
||
|
@item.setAttribute("id", "account-sidebar")
|
||
|
@item.setAttribute("class", "account-sidebar")
|
||
|
|
||
|
React.render(<AccountSidebar /> , @item)
|
||
|
|
||
|
atom.workspace.addColumnItem(@item, "left-sidebar")
|
||
|
|
||
|
deactivate: ->
|
||
|
React.unmountComponentAtNode(@item)
|
||
|
@item.remove()
|
||
|
@item = null
|
||
|
|
||
|
serialize: -> @state
|