Mailspring/internal_packages/preferences/lib/preferences-header.cjsx
Evan Morikawa fa3a2ee631 feat(signatures): add signature support in preferences
Summary:
Adding signature support in preferences

Extracting out DraftStore extensions from the Contenteditable component

Moved Contenteditable to the nylas component kit

Build react remote window selection synchronization.

Test Plan: todo

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2204
2015-10-29 17:20:41 -04:00

38 lines
1.1 KiB
CoffeeScript

React = require 'react'
_ = require 'underscore'
{RetinaImg, Flexbox} = require 'nylas-component-kit'
class PreferencesHeader extends React.Component
@displayName: 'PreferencesHeader'
@propTypes:
tabs: React.PropTypes.array.isRequired
changeActiveTab: React.PropTypes.func.isRequired
activeTab: React.PropTypes.object
render: =>
if process.platform is "win32"
imgMode = RetinaImg.Mode.ContentIsMask
else
imgMode = RetinaImg.Mode.ContentPreserve
<div className="preference-header">
{ @props.tabs.map (sectionConfig) =>
classname = "preference-header-item"
classname += " active" if sectionConfig is @props.activeTab
<div className={classname} onClick={ => @props.changeActiveTab(sectionConfig) } key={sectionConfig.sectionId}>
<div className="phi-container">
<div className="icon">
<RetinaImg mode={imgMode} {...sectionConfig.nameOrUrl()} />
</div>
<div className="name">
{sectionConfig.displayName}
</div>
</div>
</div>
}
</div>
module.exports = PreferencesHeader