Mailspring/internal_packages/account-sidebar/lib/account-sidebar-sheet-item.cjsx
dillon c059b51fe3 fix(account-sidebar): make folder and label names wrap elegantly. fixes T3402.
Summary:
WIP: changing the rest of items to make them look correct

fix last draft item in sidebar

add more padding

Test Plan: tested manually. all tests remain green.

Reviewers: evan, bengotow

Reviewed By: bengotow

Maniphest Tasks: T3402

Differential Revision: https://phab.nylas.com/D1943
2015-08-31 10:47:25 -07:00

35 lines
1 KiB
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" mode={RetinaImg.Mode.ContentIsMask} />
else
icon = <RetinaImg name={"folder.png"} mode={RetinaImg.Mode.ContentIsMask} />
<div className={classSet} onClick={@_onClick}>
<div className="icon">{icon}</div>
<div className="name">{@props.item.name}</div>
</div>
_onClick: (event) =>
event.preventDefault()
Actions.selectRootSheet(@props.item)
module.exports = AccountSidebarSheetItem