Mailspring/internal_packages/preferences/lib/preferences-sidebar.cjsx
Ben Gotow 78dd69290d fix(prefs): Move to a sheet rather than a window, use configSchema
Summary:
This diff moves the preferences interface to a sheet in the main window, with the following benefits:
- We can put any sort of React control in it (no ReactRemote)
- It's not strange for the interface to scroll
- Since it can scroll, it's safe to auto-generate preferences for plugins based on their package config schema.

The general tab is now mostly based on the config schema, with the exception of the "Workspace" and "Layout" bits.

The other tabs are still manual, and should be polished more.

Test Plan: No new tests

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2278
2015-11-23 12:20:51 -08:00

31 lines
828 B
CoffeeScript

React = require 'react'
_ = require 'underscore'
{RetinaImg, Flexbox} = require 'nylas-component-kit'
{Actions} = require 'nylas-exports'
class PreferencesSidebar extends React.Component
@displayName: 'PreferencesSidebar'
@propTypes:
sections: React.PropTypes.array.isRequired
activeSectionId: React.PropTypes.string
render: =>
<div className="preferences-sidebar">
{ @props.sections.map ({sectionId, displayName}) =>
classname = "item"
classname += " active" if sectionId is @props.activeSectionId
<div key={sectionId}
className={classname}
onClick={ => Actions.switchPreferencesSection(sectionId) }>
<div className="name">
{displayName}
</div>
</div>
}
</div>
module.exports = PreferencesSidebar