mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-12 04:25:31 +08:00
68343ec472
Summary: This diff moves us up to React 0.13.2 and transitions some of the core React components to the new syntax based on plain Javascript objects. `setInitialState` is now just code in the constructor, `getDOMNode(@)` is now `React.findDOMNode(@)`, and `isMounted` is no longer necessary or available. This diff also adds `RegisteredComponent` to match `RegisteredRegion`. In another diff, I think we should change the names of these to be `DynamicComponent` and `DynamicComponentSet`. This diff also includes preliminary API Reference docs for Menu.cjsx and Popover.cjsx. You can build the docs using `grunt docs` from the build folder. It produces a simple html format now, but it's easy to customize. Also we now ignore "Unnecessary fat arrow" Test Plan: Run tests Reviewers: evan Reviewed By: evan Differential Revision: https://review.inboxapp.com/D1437
22 lines
627 B
CoffeeScript
22 lines
627 B
CoffeeScript
React = require 'react'
|
|
classNames = require 'classnames'
|
|
{Actions, Utils, WorkspaceStore} = require 'inbox-exports'
|
|
{RetinaImg} = require 'ui-components'
|
|
|
|
module.exports =
|
|
AccountSidebarSheetItem = React.createClass
|
|
displayName: 'AccountSidebarSheetItem'
|
|
|
|
render: ->
|
|
classSet = classNames
|
|
'item': true
|
|
'selected': @props.select
|
|
|
|
<div className={classSet} onClick={@_onClick}>
|
|
<RetinaImg name={"folder.png"} colorfill={@props.select} />
|
|
<span className="name"> {@props.item.name}</span>
|
|
</div>
|
|
|
|
_onClick: (event) ->
|
|
event.preventDefault()
|
|
Actions.selectRootSheet(@props.item)
|