Mailspring/internal_packages/account-sidebar/lib/account-sidebar-sheet-item.cjsx
Evan Morikawa 4619871e8d refactor(utils): switch to regular underscore
Summary:
Fixes: T1334

remove final InboxApp references

move out all underscore-plus methods

Mass find and replace of underscore-plus

sed -i '' -- 's/underscore-plus/underscore/g' **/*.coffee
sed -i '' -- 's/underscore-plus/underscore/g' **/*.cjsx

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1534
2015-05-19 16:06:59 -07:00

35 lines
1,011 B
CoffeeScript

React = require 'react'
_ = require 'underscore'
classNames = require 'classnames'
{Actions, Utils, WorkspaceStore} = require 'nylas-exports'
{RetinaImg} = require 'nylas-component-kit'
class AccountSidebarSheetItem extends React.Component
@displayName: 'AccountSidebarSheetItem'
render: =>
classSet = classNames
'item': true
'selected': @props.select
if @props.item.icon and @props.item.icon.displayName?
component = @props.item.icon
icon = <component selected={@props.select} />
else if _.isString(@props.item.icon)
icon = <RetinaImg name={@props.item.icon} fallback="folder.png" colorfill={@props.select} />
else
icon = <RetinaImg name={"folder.png"} colorfill={@props.select} />
<div className={classSet} onClick={@_onClick}>
{icon}
<span className="name"> {@props.item.name}</span>
</div>
_onClick: (event) =>
event.preventDefault()
Actions.selectRootSheet(@props.item)
module.exports = AccountSidebarSheetItem